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

Conformance Testing Setup for Shim #134

Merged
merged 9 commits into from
Jun 27, 2024

Conversation

kate-goldenring
Copy link
Collaborator

@kate-goldenring kate-goldenring commented Jun 6, 2024

Spin has created a set of conformance test to ensure all Spin runtimes conform to baseline requirements/expectations
Status: runs conformance test to successful termination 🎉

This is very draft:

@kate-goldenring
Copy link
Collaborator Author

@rylev for visibility

Copy link
Member

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

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

Oh nice that's great, is the plan to add this to the CI?

conformance-tests/README.md Show resolved Hide resolved
conformance-tests/src/main.rs Outdated Show resolved Hide resolved
conformance-tests/src/main.rs Outdated Show resolved Hide resolved
@rylev
Copy link
Contributor

rylev commented Jun 18, 2024

@Mossaka indeed the idea is to add this to CI, but I think we'll wait until we're confident that this can run more quickly and reliably than it currently can. The issue is that this requires pushing to an OCI registry, and we're currently using ttl.sh which is probably not a viable strategy.

@kate-goldenring What do you think about merging this as is? I'm fine keeping this as a draft PR until we add this to CI (and I can just keep making PRs to your branch), but it also might be easier to just merge and make PRs directly to this repo instead of your fork.

@kate-goldenring kate-goldenring marked this pull request as ready for review June 18, 2024 16:23
@kate-goldenring kate-goldenring changed the title DRAFT: Conformance Testing Setup for Shim Conformance Testing Setup for Shim Jun 19, 2024
@kate-goldenring
Copy link
Collaborator Author

kate-goldenring commented Jun 19, 2024

@rylev I agree we should merge the tests as is and add CI later. @Mossaka do you mind giving a review?

Copy link
Member

@radu-matei radu-matei left a comment

Choose a reason for hiding this comment

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

Great to see this!
Left a few non-blocking comments.

LGTM

conformance-tests/src/main.rs Outdated Show resolved Hide resolved
conformance-tests/src/main.rs Outdated Show resolved Hide resolved
conformance-tests/src/main.rs Show resolved Hide resolved
conformance-tests/src/main.rs Show resolved Hide resolved
@Mossaka
Copy link
Member

Mossaka commented Jun 25, 2024

Need a rebase

kate-goldenring and others added 7 commits June 25, 2024 08:44
Signed-off-by: Kate Goldenring <[email protected]>
Signed-off-by: Ryan Levick <[email protected]>
Signed-off-by: Ryan Levick <[email protected]>
Signed-off-by: Ryan Levick <[email protected]>
Signed-off-by: Ryan Levick <[email protected]>
Signed-off-by: Kate Goldenring <[email protected]>
@kate-goldenring
Copy link
Collaborator Author

For now, I am skipping the TCP tests as they are failing #147

conformance-tests/src/main.rs Outdated Show resolved Hide resolved
conformance-tests/src/main.rs Outdated Show resolved Hide resolved
.next()
.expect("expected second arg to be path to ctr binary");

'test: for test in conformance_tests::tests_iter(&tests_dir).unwrap() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the reason you're not using conformance_tests::run_tests because the tests run in parallel? Should we provide an API that allows the tests to not run in parallel?

That API is preferred since it gives better test output based on libtest-mimic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wasn't aware of the run_tests API being added. I can change to use that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Running them in parallel we run into issues concurrently pushing to the local registry

Copy link
Collaborator Author

@kate-goldenring kate-goldenring Jun 26, 2024

Choose a reason for hiding this comment

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

Okay, got them running in parallel. There was an issue with the registry service not coming up -- restarting docker resolved it. Commit c3a0a58 leverages run_test and updates these tests to configure the port for the Spin app and generate a random hash for the run ID to enable running the tests in parallel.

conformance-tests/src/main.rs Outdated Show resolved Hide resolved
conformance-tests/src/main.rs Outdated Show resolved Hide resolved
…allel

- Set unique port for each run
- Set unique ctr run ID for each run

Signed-off-by: Kate Goldenring <[email protected]>
@kate-goldenring kate-goldenring merged commit 066301f into spinkube:main Jun 27, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants