-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(e2e): add comprehensive end-to-end tests and improve CI workflows #222
base: main
Are you sure you want to change the base?
Conversation
* test: add health check e2e test * test: add latency check e2e test * test: add dns check e2e test * test: add file loader e2e test * fix: add missing version in openapi spec * chore: use go-yaml instead of yaml.v3 * chore: skip go files in bash e2e tests Signed-off-by: lvlcn-t <[email protected]>
* fix: race conditions in check shutdown * fix: set openapi version on build time * refactor: check base naming Signed-off-by: lvlcn-t <[email protected]>
* fix: gosec SAST scan ci job * feat: upload gosec report to github security page Signed-off-by: lvlcn-t <[email protected]>
* ci: rename workflows to kebab-case * chore: introduce naming pattern for test workflows * chore: bump e2e k3s v1.31.2-k3s1 Signed-off-by: lvlcn-t <[email protected]>
Signed-off-by: lvlcn-t <[email protected]>
Signed-off-by: lvlcn-t <[email protected]>
Signed-off-by: lvlcn-t <[email protected]>
* test: add additional e2e tests for check reconfiguration * fix: race conditions in all checks when reconfiguring while running checks * refactor: add check base constructor * fix: add missing json tags for dns check result struct * chore: use time ticker instead of time.After for check intervals * fix: only update check config if it has changed * chore: improve naming in checks * chore: unexpose private functions & structs * refactor: simplify check config & e2e test builder Signed-off-by: lvlcn-t <[email protected]>
Signed-off-by: lvlcn-t <[email protected]>
Signed-off-by: lvlcn-t <[email protected]>
Signed-off-by: lvlcn-t <[email protected]>
Signed-off-by: lvlcn-t <[email protected]>
Signed-off-by: lvlcn-t <[email protected]>
* fix: metrics endpoints content type setting (was ineffective thus always returning text/plain) Signed-off-by: lvlcn-t <[email protected]>
Signed-off-by: lvlcn-t <[email protected]>
Signed-off-by: lvlcn-t <[email protected]>
…ed logic Signed-off-by: lvlcn-t <[email protected]>
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Motivation
This PR adds E2E tests to Sparrow to make sure its core features work as expected in (almost) real-world conditions. These tests simulate how the application is used and improving reliability and stability.
I didn’t include E2E tests for the target manager component to keep the PR manageable. Those will come in a follow-up PR. This one is already quite large because I included both the E2E tests and the framework setup in one place to avoid splitting discussions across multiple smaller PRs.
Changes
E2E Testing Framework
A new testing framework was added to make it easier to write and run E2E tests. It includes:
New E2E Tests
Here are the tests added in this PR:
In the future, this framework might be extended to cover existing unit tests, but that may require major restructuring (e.g., moving tests into
<package>_test
or reorganizing packages).Bug Fixes
This PR also fixes several issues:
application/json
instead oftext/plain
.Refactoring and Code Simplifications
Some general improvements were made to simplify the code:
CI/CD Pipeline Updates
The CI/CD pipeline was improved with these changes:
tparse
for cleaner test output formatting.gosec
results to GitHub’s security page and scheduled regular SAST scans.Dependency Updates
The YAML library was updated from
yaml.v3
togo-yaml
because it’s actively maintained, and works better with modern Go versions.Tests Done
All tests passed:
Next Steps