-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add initial E2E test and structure
This adds a single test to create a CAPMVM workload cluster and a bit of structure so that more tests can be added later. Note that only CAPMVM on the current branch is tested, not released versions or upgrades between versions. I have deliberately left it so we can add those bit by bit after the general setup is merged in. I have a lot more to do in the e2e saga, but this is a first step which is useable. I used the CAPI test framework[1] which seems to be something of a standard across providers, although it is a bit unwieldy. Everything can be found under `test/e2e/`. The contents of `test/e2e/data` are mostly yaml and can be ignored. The dir `test/e2e/config` contains the config file used by the CAPI test framework. Other config files can be passed in via test params but this is the default. The test itself is at `test/e2e/e2e_test.go` and `test/e2e/e2e_suite_test.go`. The suite performs some env setup and teardown by way of a manager. It is assumed for now that the tests are not run in parallel (there is only one of them) so I did not set up any synchronization between nodes, but that will need to be done as we add more tests and parallelization. The test creates a cilium flavour cluster, mainly because I could not get the other one to work and did not want to spend a lot of time fixing that. After the cluster is created it checks that all flintlock hosts were used, and that a simple application can be successfully deployed. In `test/e2e/utils` there are a bunch of helper things, which will probably end up being broken up as they expand: - `params.go` sets up test flags - `defaults.go` holds defaults for test flags - `utils.go` is a bunch of helper funcs used by the test - `clusterctl.go` contains some functions I copied from the framework because I had to edit them and they are not hugely flexible. - `manager.go` holds some objects and methods which handle environment setup/teardown and shared test information. The test can be run locally by: - Starting 1 or more flintlock servers - Exporting the server addresses `export FLINTLOCK_HOSTS="1.2.3.4:9090,5.6.7.8:9090"` - Running `make e2e` [1]: https://pkg.go.dev/sigs.k8s.io/cluster-api/test/framework
- Loading branch information
1 parent
18f3e38
commit f37a153
Showing
23 changed files
with
2,162 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.