Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial E2E tests [running locally] #187

Merged
merged 5 commits into from
Nov 1, 2021

Conversation

Callisto13
Copy link
Member

@Callisto13 Callisto13 commented Oct 29, 2021

The long awaited E2E tests!! Will they live up to the hype?!

Probably not since this is only a small piece from a long list and there is no guarantee whatsoever that they will work for anyone else.

This PR adds:

  • A Dockerfile (and friends)
    • Which can be used to run a container (in a very specific way) with all the "things" one needs to play with flintlockd
    • There are some make commands to interact with said Dockerfile, I have set up a remote repo so people can pull if they don't feel like building, but that is non essential for now.
  • Some initial CRUD tests for flintlockd
    • These are written in Go
    • They are all one test, because that is cheaper. This can be expanded/changed as we go.
    • They test only the happy path, as I am hoping all the control logic and edges will be caught in Units.

This PR removes:

  • All the previously existing Terraform stuff

This PR does not:

  • Do many things
  • One of which is run any tests in Equinix as part of a nightly build

This is just the initial bit to get us by, so much will change, for instance:

  • Right now there are various placeholder checks in test/e2e/e2e_test.go which ensure a mVM has started. This was just until the Get was merged, so I am actually gonna replace that right now this second. Done
  • The devicemapper thinpool setup is currently sitting in an entrypoint script and run on container start. This is very finicky when it comes to tearing down, so I am going to move that into the test itself. (Balazs it was the trap bit which was irritating me earlier. Like always the option you choose to be a shortcut is the most time consuming.)
  • There is a very poorly named thing which handles starting and cleaning containerd and flintlockd processes (test/e2e/utils/runner.go), so please suggest whatever.
  • The container image is built by calling a bootstrap.sh script. I might change it because this is kindof useful and also kindof not.
    • Useful: other people can run the script on their machine to set up their stuff so it is multipurpose
    • Not: if one bit of the script changes then basically all the image layers need to be rebuilt which is a bummer
  • Does it even need to run in a container at all tho?! I mean if we have to mount /dev and share the ipc namespace .....
  • We may also want to use more Ginkgo things for this. Eg, they have a nice teardown wrapper which will capture signals and ensure teardown/cleanup is still executed if the tests are interrupted.

Coming soon to a test suite near you:

  • Configurable params!!
  • A metal option!!!
  • Some sexy python tooling!!
  • Developer docs!!
  • And much more!!!

these are all in various states of preparedness and idk which order they will appear in

@Callisto13 Callisto13 added area/testing Indicates an issue related to test kind/feature New feature or request labels Oct 29, 2021
@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2021

Codecov Report

Merging #187 (934db93) into main (7b95d77) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #187   +/-   ##
=======================================
  Coverage   54.89%   54.89%           
=======================================
  Files          45       45           
  Lines        1991     1991           
=======================================
  Hits         1093     1093           
  Misses        791      791           
  Partials      107      107           
Impacted Files Coverage Δ
core/application/errors.go 0.00% <ø> (ø)
core/models/volumes.go 0.00% <ø> (ø)
core/application/query.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd8dac9...934db93. Read the comment docs.

hack/scripts/devpool.sh Outdated Show resolved Hide resolved
jmickey
jmickey previously approved these changes Oct 29, 2021
Copy link
Contributor

@jmickey jmickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant stuff! Read it twice and the only thing I found was a rogue space

@Callisto13
Copy link
Member Author

@jmickey updated to include Get and List

// What it does is compile flintlockd and start containerd and flintlockd.
// So 'TestSetterUpper' did not sound as slick, but that is what it is.
// I am happy for literally any suggestions.
type Runner struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bootstrapper?

Also not coming up with any decent ideas.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is more coming to it soon, so maybe inspiration will strike

jmickey
jmickey previously approved these changes Nov 1, 2021
@Callisto13
Copy link
Member Author

sorry i had to re-push + dismiss bc apparently my last commit was not signed 🤦‍♀️

jmickey
jmickey previously approved these changes Nov 1, 2021
@Callisto13
Copy link
Member Author

oh ffs

@Callisto13
Copy link
Member Author

LOL and now none of them have it

@Callisto13 Callisto13 merged commit 7596811 into weaveworks-liquidmetal:main Nov 1, 2021
@Callisto13 Callisto13 deleted the init-e2e branch November 1, 2021 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Indicates an issue related to test kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants