-
Notifications
You must be signed in to change notification settings - Fork 80
Refactor e2e tests with wiremock scenarios #713
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
Conversation
|
The server logs have some messages about not being able to write to The one bummer here is that we now reset state between test runs, which means modifying the database, checked out repos, and so on. The upside is we have a clean state on each run and can truly inspect the results of each test. The downside is that you can no longer just start Small additional hassle, but I'm not sure of a better way to get around it...if you're on linux you can just do E2E Tests » Endpoints » Jobs » Status endpoint
✓︎ can reach the status endpoint
E2E Tests » Endpoints » Jobs » Jobs list
✓︎ lists jobs and respects include_completed filter
E2E Tests » Endpoints » Jobs » Jobs API error handling
✓︎ returns HTTP 404 for non-existent job ID
E2E Tests » Endpoints » Publish » Publish workflow
✓︎ can publish effect@4.0.0 and filter logs
E2E Tests » Endpoints » Publish » Publish state machine
✓︎ returns same jobId for duplicate publish requests
E2E Tests » Endpoints » Unpublish » Publish-Unpublish workflow
✓︎ can publish effect@4.0.0 then unpublish it
E2E Tests » Endpoints » Transfer » Transfer workflow
✓︎ can transfer effect to a new location
E2E Tests » Workflows » GitHubIssue » GitHubIssue end-to-end
✓︎ handles publish via GitHub issue, posts comments, and closes issue on success
✓︎ posts failure comment and leaves issue open when job fails
✓︎ calls Teams API to verify trustee membership for authenticated operation
✓︎ posts error comment when issue body contains invalid JSON
E2E Tests » Workflows » Multi-operation » Concurrent git operations
✓︎ git repos remain clean after all matrix jobs complete
E2E Tests » Workflows » Multi-operation » Dependency and unpublish interactions
✓︎ publishing a package fails when its dependency was unpublished
✓︎ unpublishing a package fails when dependents exist in manifest index
E2E Tests » Workflows » Multi-operation » Job priority
✓︎ second publish job completes before first package's matrix jobs finish |
|
|
||
| -- Verify seeded matrix jobs exist (prelude and type-equality are seeded by test env) | ||
| let | ||
| seededPackages = [ Fixtures.prelude.name, Fixtures.typeEquality.name ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is potentially an artifact of WIP code? But the server always starts off with matrix jobs to build for existing published packages.
also adds a number of new e2e tests for various scenarios
5afe39b to
1cf1eba
Compare
that's fine and possibly better if we can bundle that in a single invocation. how does one terminate wiremock? is it now started by the tests, or how does that work? |
It's the same as before — |
|
The new way to run the env is: # to start the wiremock servers, git mocks, etc.
nix run .#test-env -- --tui
# to execute the tests
spago-test-e2eThey're intentionally separate because this lets you iterate on tests and keep running |
* Update database schemas and add job executor loop * Split Server module into Env, Router, JobExecutor, and Main * Fix up build * Run job executor * Fix integration tests * WIP matrix builds * add missing version to publish fixtures the publishCodec requires a version file but the test fixtures weren't updated to include it * Add missing packageName and packageVersion to InsertMatrixJob The JS insertMatrixJobImpl expects columns [jobId, packageName, packageVersion, compilerVersion, payload] but the PureScript types were missing packageName and packageVersion * Fix finishedAt timestamp to capture time after job execution * Implement matrix jobs, and the recursive enqueuing of new ones * Reset incomplete jobs so they can be picked up again * Run matrix jobs for the whole registry when finding a new compiler version * resolve build issues * fix smoke test * Split package jobs into separate tables, return all data from the job endpoint * implement thin client for github issues replaces the old GitHubIssue which ran registry jobs directly with one that hits the registry api instead. also added integration tests that ensure various jobs can be kicked off as github issue events and we get the resulting comments, issue close events, etc. * clean up test failures * reinstate missing comments * Remove COMMENT effect, add NOTIFY log * Implement endpoint for returning jobs * Check for existing jobs before enqueueing new ones * Add E2E test: publishing a package enqueues matrix jobs * Add E2E test: run a whole-registry upgrade when detecting a new compiler * Don't fail job fetch on unreadable logs * Fix archive seeder build * remove effect-4.0.0 from storage in unit tests * avoid race condition in initial jobs test The "can list jobs" test was asserting that initial matrix jobs have success: true, but the job executor runs asynchronously and jobs may not have completed by the time the test queries the API. Fixed by normalizing the 'success' field to a constant before comparison. * format * second test * Refactor e2e tests with wiremock scenarios (#713) * refactor e2e tests with wiremock scenarios also adds a number of new e2e tests for various scenarios * format, etc. * move out fixtures * relax cache deletion * strengthen assertions, fix discovered bugs * drop ref, move to manifest (#714) * review feedback * more feedback * trim tests down a bit to optimize speed to ~60s * Add endpoint for package set jobs + e2e tests for it * tweak unpublish test to verify matrix jobs fail gracefully * tweak agents to refer to scratch logs * remove slow archive seeder test * fix tests by bumping compiler --------- Co-authored-by: Thomas Honeyman <hello@thomashoneyman.com> Co-authored-by: Fyodor Soikin <name.fa@gmail.com> Co-authored-by: pacchettibotti <pacchettibotti@purescript.org> Co-authored-by: Thomas Honeyman <admin@thomashoneyman.com>
This adds a wiremock state machine in config.nix so that we can transition package states in mock environments. Specifically, we can do something like publish
effect-4.0.0, at which point its tarball will be available in storage, theavailable-versionsreturned by Pursuit include the version, and so on.The reason to do this is so we can try workflows like: publish effect-4.0.0, then publish console-6.0.0 (which depends on effect), and then try to unpublish effect-4.0.0 (should not be possible, because console depends on it).
I've implemented this, and I've also added a number of new e2e tests. Specifically:
Basic idea is to merge this into the
concurrent-jobsbranch to be our test suite as we continue iterating on things.