Repository navigation
e2e testing - #141
e2e testing#141
Conversation
| - | | ||
| cd /deploy-sourcegraph-docker | ||
| ./deploy.sh | ||
| - "/deploy-sourcegraph-docker/test/pure-docker/smoke-test.sh" |
There was a problem hiding this comment.
It looks like you have removed all of the logic I had for ensuring that permissions on volume directories hasn't changed: https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/141/files#diff-b584b34513d743c4570b69a661750e14L37-L64
We need to add this back, we can't remove it because this is a really important property to test for. The customer using this, https://app.hubspot.com/contacts/2762526/company/407948923/ does not have the ./ensure-volume.sh $VOLUME 100 invocations and that must be communicated through the upgrading docs as I said here: https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/141/files#diff-b584b34513d743c4570b69a661750e14L50-L51
There was a problem hiding this comment.
I have a PR with the information pending here
All of the deploy-.sh scripts that require a volume now envoke ensure-volume.sh. Is this customer running a specific fork that doesn't include that? If so, wouldn't it make more sense for them to have that script?
There was a problem hiding this comment.
I am not sure how to avoid this confusion, but see the README of this repository for an explanation of what pure-docker deployments actually are:
The goal is that anyone using a container management platform other than Kubernetes (Netflix's Titus, Apache's Mesos, etc.) would be able to use this repository as a reference for how to deploy Sourcegraph.
The point being the customer in question does NOT run the scripts in this repository, and any time there are changes in volume permissions etc. they need to know about those precisely because it means they need to be able to adapt those to their deployment in their own way. It's not a fork - it's the way they were intended to consume this repository (as a reference)
There was a problem hiding this comment.
The point being: we need these lines to still exist in this test somewhere, removing them means we can't in good faith release pure docker to this customer and the test becomes effectively useless
There was a problem hiding this comment.
The most obvious solution to me here is to remove the deploy.sh call above and move all of this logic (deployment and other smoke tests) directly into smoke-test.sh - I am happy to do that now if you're OK with that
There was a problem hiding this comment.
Side note: It's not really clear what should be in shell commands here vs. in smoke-test.sh
There was a problem hiding this comment.
Personally, I am inclined to put the heavy duty tasks in the scripts ie: setting up volumes, testing and then execute those scripts in the shell commands.
Previously when I've used this harness I'd been a quick and easy way to just comment out a script in shell commands if I've wanted to run the vagrant box then ssh in to manually test or tweak things before committing them.
FYI I've moved the setup and configuration part of the test process into a new script, and the testing itself is still done with smoke-test.sh
There was a problem hiding this comment.
My 2c, I would think of it the same way you think about the CI pipeline yaml.
- Steps are listed in the yaml
- Each step is unit of work that does not know about the others
There was a problem hiding this comment.
I won't block this further because I am content with this as-is, so feel free to merge.
But the organization here still doesn't make much sense to me.
setup.shdoesn't install dependencies, theVagrantfiledoes- The main property being tested by these tests is in fact the static permissions on volume directories, but we've placed that in a
setup.shfile - why is testing done in a setup file? Should this be renamed toperms-test.sh? smoke-test.shrelies on the work thatsetup.shis doing by setting up the volume directories - when this test fails insmoke-test.shbecause a container fails to come up with e.g. wrong permissions, someone will need to findsetup.shand fix permissions there. This seems not super intuitive to me.servers.yamlis callingdeploy.shand is "responsible for starting the deployment" butsmoke-test.shis responsible for actually ensuring the containers came up OK?
Maybe I am missing something, but the structure that would make a lot more sense to me is:
servers.yamlonly callssmoke-test.sh, nothing else.- everything in
setup.shcurrently goes intosmoke-test.sh - dependency installation goes into an external script
setup.sh(and thusVagrantfilebecomes something we can just copy for other test suites in the future.)
|
@davejrt @pecigonzalo I am not sure I follow what the motivation here is for using different GCP projects when running this locally vs. in CI - what is the rationale for that? I think it would make more sense to have it always run in the same GCP project always |
|
Looks pretty good, some things I'd like you to follow up on and then I'll re-review |
The main intention was to remove it from the production project, and then a second intention was having them in |
da0e0c6 to
ca271bb
Compare
|
Separation of dev and CI assets for cost-accounting purposes makes sense, I didn't think of that. Thanks! |
|
Last thing to address here is #141 (comment) I think |
emidoots
left a comment
There was a problem hiding this comment.
more suggestion / feedback inline here: https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/141/files#r481383157
but this state is clearly better than what is in master now, so feel free to move forward on this.
This PR is an attempt at the following:
Merge the smoke tests previously written by @slimsag
Enable testing on the baremetal agents using vagrant for a clean build environment
Some things to note:
There are currently two vagrant providers configured (vagrant-google and virtualbox). Virtualbox runs the vagrant box locally on the baremetal agent, and can be used to run tests locally as well as in CI. vagrant-google will provision a GCE instance and run the tests on that server, in the event that performance is an issue or a local dev environment does not have sufficient CPU and memory.
This PR in draft uses 8cpu and 8GB of RAM for the virtualbox. After testing to address sourcegraph/sourcegraph#12996 the best I can determine is that there's an issue with virtualbox in this environment and using anymore than 8vcpus seems to degrade performance to the point where these tests don't run. As a result as part of the test a maximum of 8 cpus are used for the zoekt services in order to actually run the tests. With no more than 8vcpus I have been able to reliably have tests run in ~16 minutes and 10 minutes using the vagrant-google plugin (which runs fine without the need to modify any cpu counts on services).