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

Issue-105, Brro Compressor E2E Tests and test workflow imrpovement #117

Merged
merged 6 commits into from
Sep 24, 2024

Conversation

worryg0d
Copy link
Collaborator

@worryg0d worryg0d commented Sep 5, 2024

Workflow improvement

The current workflow sequentially checks all crates in the workspace until one fails.

This PR solves this problem by running a script that runs cargo clippy on each project in the workspace separately. If one of those checks fails it stops the job when all checks are completed.

Brro Compressor E2E

This PR covers the brro compressor CLI tool with a few e2e tests. It mostly covers compression and decompression flows.

Relates to #105

@worryg0d worryg0d added the enhancement New feature or request label Sep 5, 2024
@worryg0d worryg0d self-assigned this Sep 5, 2024
@worryg0d worryg0d marked this pull request as draft September 5, 2024 12:07
@worryg0d
Copy link
Collaborator Author

worryg0d commented Sep 9, 2024

Tests fail here until #118 is fixed

@worryg0d worryg0d requested a review from rukai September 18, 2024 08:21
@@ -48,8 +48,28 @@ jobs:
- name: Ensure that all crates compile and have no warnings under every possible combination of features
# some things to explicitly point out:
# * clippy also reports rustc warnings and errors
# * clippy --all-targets causes clippy to run against tests and examples which it doesnt do by default.
run: cargo hack --feature-powerset clippy --all-targets --locked ${{ matrix.cargo_flags }} -- -D warnings
# * clippy --all-targets causes clippy to run against tests and examples which it doesn't do by default.
Copy link
Contributor

@rukai rukai Sep 23, 2024

Choose a reason for hiding this comment

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

I think we could achieve this more simply as:

run:
  # Display all clippy lint failures as warnings
  cargo hack --feature-powerset clippy --all-targets --locked ${{ matrix.cargo_flags }}
  # Fail CI on the first crate to fail clippy lints
  cargo hack --feature-powerset clippy --all-targets --locked ${{ matrix.cargo_flags }} -- -D warnings

Its the -D warnings that causes clippy to abort and not continue on to other crates.
But we also need the -D warnings to actually return non-zero exit code and fail CI.

Its also worth noting that clippy is easy to run locally, it is automatically installed already and you can just cargo clippy to see most of the failures locally. (I think it skips tests and benches) Since we dont use any features in fft-compressor yet: cargo clippy --all-targets will test everything including tests/benches

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks a lot! I like this approach much more. I added this one to the CI job.

@cjrolo cjrolo merged commit ba33edf into main Sep 24, 2024
2 checks passed
@cjrolo cjrolo deleted the issue-105 branch September 24, 2024 13:00
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.

4 participants