Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix test execution issues when running cargo tests passing non-SWS arguments #466

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

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

joseluisq
Copy link
Collaborator

@joseluisq joseluisq commented Jul 22, 2024

Description

This PR fixes an issue when running tests via Cargo with additional non-SWS arguments.
This was because SWS tried to parse CLI arguments in a test context.

Now, SWS won't parse arguments by default when running tests. So the following command will work as expected (run all tests):

cargo test -- --test-threads 1 --nocapture

Related Issue

It fixes #465

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

When running tests with additional non-sws arguments, tests execution
fails because sws is trying to parse cli arguments anyways.

Now, sws won't parse arguments by default when running tests.
For example, the following command will work as expected:

cargo test -- --test-threads 1 --nocapture
@joseluisq joseluisq added v2 v2 release bugfix This is PR fixes a bug testing labels Jul 22, 2024
@joseluisq joseluisq self-assigned this Jul 22, 2024
Copy link

semanticdiff-com bot commented Jul 22, 2024

Review changes with SemanticDiff.

Analyzed 6 of 6 files.

Overall, the semantic diff is 17% smaller than the GitHub diff.

Filename Status
✔️ tests/compression.rs Analyzed
✔️ tests/handler.rs Analyzed
✔️ tests/redirects.rs Analyzed
✔️ tests/rewrites.rs Analyzed
✔️ src/testing.rs Analyzed
✔️ src/settings/mod.rs 23.05% smaller

@joseluisq joseluisq linked an issue Jul 22, 2024 that may be closed by this pull request
2 tasks
@joseluisq joseluisq merged commit 915d040 into master Jul 22, 2024
39 checks passed
@joseluisq joseluisq deleted the fix-config-for-tests branch July 22, 2024 19:32
@joseluisq joseluisq added this to the v2.33.0 milestone Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This is PR fixes a bug testing v2 v2 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests fail because CLI options are parsed
1 participant