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

CI/CD: New workflow for testing and static analysis #98

Merged
merged 5 commits into from
Mar 14, 2024

Conversation

macie
Copy link
Contributor

@macie macie commented Mar 12, 2024

This PR introduces new workflow which performs:

after each commit and PR.

I've also fixed existing violations and added a few basic test cases (more info inside commit messages)

macie added 5 commits March 11, 2024 20:35
Reveal intentions by:
- extracting magic numbers into constants
- changing function names with >1 responsibilities
- documenting non-obvious behaviors.
Tests performed on real-like packets secure expected behavior.
Runs tests and linters after each commit.
Fixed:
- "ineffective break statement. Did you mean to break out of the outer loop?" (SA4011)
- "channels used with os/signal.Notify should be buffered" (SA1017)
- "os.Kill cannot be trapped (did you mean syscall.SIGTERM?)" (SA1016)
- "func envOrDefaultBool is unused" (U1000)
- "should use time.Since instead of time.Now().Sub" (S1012)
This tests fails when there are no specific binary files, but there is
no method to get the files during test.

Marking the tests as a skipped will gives us a false sense of security. So it's
better to remove it at all.
@macie macie mentioned this pull request Mar 12, 2024
@tobyxdd tobyxdd requested review from tobyxdd and haruue March 13, 2024 00:13
@tobyxdd tobyxdd self-assigned this Mar 13, 2024
@tobyxdd tobyxdd added the enhancement New feature or request label Mar 13, 2024
@tobyxdd
Copy link
Collaborator

tobyxdd commented Mar 14, 2024

Thank you for your contribution! I will merge this for now and work on the TODO/FIXME items mentioned in the comments later.

@tobyxdd tobyxdd merged commit 920783b into apernet:master Mar 14, 2024
2 checks passed
@macie macie deleted the ci branch March 14, 2024 06:58
@macie macie mentioned this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants