Repository navigation
introduce new integration test suite - #6479
Conversation
| ARG base_image=concourse/dev | ||
| FROM ${base_image} AS base | ||
|
|
||
| # generate keys (with 1024 bits just so they generate faster) |
There was a problem hiding this comment.
These keys are now checked in, so they don't need to be generated in dev builds anymore. This makes it easier to run the tests against both 'dev' images and 'latest' Concourse images (e.g. upgrade/downgrade tests).
After #6115 was merged, all the Bosh Topgun tests exercising Vault started failing. This is not due to the Vault integration being broken (well, not really) - Bosh topgun is just using such an old (custom) version of Vault that is no longer compatible I gather. Since we're going to end up replacing all these tests shortly with a new test suite (introduced in #6479), let's just skip these Vault tests for now Signed-off-by: Aidan Oldershaw <[email protected]>
aoldershaw
left a comment
There was a problem hiding this comment.
Just done a really quick pass, but looks really cool so far! Really like how the tests are structured. The xyztest.Cmd approach seems to be a really nice level of indirection - the tests are very readable and seem easy to write. I'm excited to extend this suite to add more high-level test coverage!
There are a couple tests that are failing for me when running locally - any ideas what might be causing that?
TODO: * break OpsSuite up so the tests can be run in parallel * naming: integration/ops/ vs. acceptance/? Signed-off-by: Alex Suraci <[email protected]>
the shorter assertions are nice, but it can't really be parallelized. if we want the shorter assertions back we can convert each test into a suite. 🤷 Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
netgo/osusergo aren't needed now that we build with CGO_ENABLED=0, and -a shouldn't be needed either way (seems like it'd just slow down compilation) Signed-off-by: Alex Suraci <[email protected]>
was never actually needed, and we can just assert using t anyhow Signed-off-by: Alex Suraci <[email protected]>
it's pretty dope (technically this is a partial commit that breaks existing code, but i wanted this to be separate 'cause it's cool, and i can't add -p the other changes because the code entirely moved) Signed-off-by: Alex Suraci <[email protected]>
pattern: for cli 'foo', have a 'footest.Init' which returns a 'footest.Cmd' which is a cmdtest.Cmd but with CLI-specific helper methods attached Signed-off-by: Alex Suraci <[email protected]>
only used by one suite, but follows the pattern and feels cleaner! Signed-off-by: Alex Suraci <[email protected]>
* rather than generating keys in the 'Dockerfile', which is slow and makes the image behave differently from the dev or shipped images, just check them in. (obviously do not use these - or any of this workflow - in production.) * same for vault certs, to make vault testing easier. * move port mappings and '.' mapping to hack/overrides/dev.yml, which is now symlinked to docker-compose.override.yml to maintain the previous 'docker-compose up' dev workflow. this will make it easier to re-use docker-compose.yml for dev images and for testing against final images. the aim here is to avoid ha Signed-off-by: Alex Suraci <[email protected]>
now that this might be running in multiple packages Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
just makes a cold run slightly easier, even though this won't always be perfect Signed-off-by: Alex Suraci <[email protected]>
the logic here was wrong, and this is an unnecessary optimization anyway Signed-off-by: Alex Suraci <[email protected]>
...primarily to make it easier to identify which subpackages are actual test suites. Signed-off-by: Alex Suraci <[email protected]>
overloading the outer docker-compose.yml for both dev and test started to feel more confusing than just keeping them separate. namely, it's impossible to un-set 'build:' in an override file, so I split that out into a docker-compose.override.yml file, symlinked under hack/overrides/ to keep ./hack/dc working, but then having the tests *not* use it, even though they use the docker-compose.yml right next to it, and even though it's normally respected by 'docker-compose' commands. Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
without this, running docker-compose in a Concourse task would fail with a cryptic error: [2558] Cannot open self /tmp/build/e55deab7/concourse/integration/ops/docker-compose or archive /tmp/build/e55deab7/concourse/integration/ops/docker-compose.pkg Signed-off-by: Alex Suraci <[email protected]> Co-authored-by: Rui Yang <[email protected]>
(though it might make sense to just make this flag the default behavior) Signed-off-by: Alex Suraci <[email protected]> Co-authored-by: Rui Yang <[email protected]>
let go test ./... handle the buffering and only show output when a package fails Signed-off-by: Alex Suraci <[email protected]> Co-authored-by: Rui Yang <[email protected]>
...not just the tag, to be consistent with how the other images are specified Signed-off-by: Alex Suraci <[email protected]> Co-authored-by: Rui Yang <[email protected]>
so we can CI it! Signed-off-by: Alex Suraci <[email protected]> Co-authored-by: Rui Yang <[email protected]>
not used in anything; just useful for troubleshooting Signed-off-by: Alex Suraci <[email protected]> Co-authored-by: Aidan Oldershaw <[email protected]>
this is more trouble than it's worth, and the test was originally introduced alongside explicit config for garden DNS - without that, this is not very reliable on developer machines (due to weird WSL2/Docker for Mac DNS) Signed-off-by: Alex Suraci <[email protected]> Co-authored-by: Aidan Oldershaw <[email protected]>
* use .ExpectExit(1) to expect it to exit(1) * use .Try/.TryOutput/.TryOutputJSON to use the error return value yourself instead this shortens almost all usage of it since they no longer need to require.NoError Signed-off-by: Alex Suraci <[email protected]>
aoldershaw
left a comment
There was a problem hiding this comment.
Having Cmd.Run assert on the error makes things really nice. Everything LGTM!
What does this PR accomplish?
This new test suite aims to consolidate the following CI jobs / test suites:
These tests are easy to run on a dev machine: just run
go test ./integration/.... They work by usingdocker-compose, so you don't need BOSH or K8s.Changes proposed by this PR:
Included so far are tests covering upgrade/downgrade, so we can replace the
upgradeanddowngradejobs in the pipeline, along with a Vault test suite which should let us remove the Vault tests from TopGun.We should add more test coverage for different auth flows before removing the Vault tests from TopGun, though - this suite doesn't provide equivalent coverage yet. Only enough to verify that Vault works. The TopGun failures are actually because it's running against a ridiculously old version of Vault (v0.7.3), because it uses the world's best Vault bosh release,
vito/vault-boshrelease. Now that we can test Vault using Docker Compose, we can eliminate our dependency on that release and even CI against newvaultDocker images as they're released.I think we should probably still have some sort of coverage for BOSH/K8s, but it should probably be reduced to only tests that are K8s or BOSH-specific - maybe they can even be unit tests. We should be able to test the same Concourse-specific lifecycle behavior through Docker Compose.
As for
testflight, there's no immediate need to pull it in, but if we want to it could probably be tucked underintegration/coreas a suite that runs against a single Docker Compose deployment.Notes to reviewer:
I went through a bit of churn while figuring out the simplest and clearest way to structure all this, so it's probably best to look at the whole diff as some commits may be made irrelevant by later commits. Let me know if anything seems really confusing! I also want to write a README under
integration/so any feedback you have would help me write it.Contributor Checklist
Reviewer Checklist
BOSH and
Helm packaging; otherwise, ignored for
the integration
tests
(for example, if they are Garden configs that are not displayed in the
--helptext).