-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add exclude-environment
config field and more stringent tests
#18
Conversation
let line_count = stdout.lines().count(); | ||
let expected_line_count = 297; | ||
assert_eq!( | ||
line_count, expected_line_count, | ||
"Unexpected number of output lines" | ||
); |
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 might be annoying to adjust every time the output format changes
i usually just assert that a specific string is contained in stdout (same for the other test cases)
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.
I did that previously.
Unfortunately since the tests are executed in CI (and local stdout differs from Github stdout) this broke things quite frequently for me.
let exit_status = output.status.code().unwrap(); | ||
assert_eq!(exit_status, 1, "Unexpected exit status"); | ||
|
||
let stdout = str::from_utf8(&output.stdout).expect("Failed to convert output to string"); |
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.
let stdout = str::from_utf8(&output.stdout).expect("Failed to convert output to string"); | |
let stdout = str::from_utf8(&output.stdout).unwrap(); |
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.
What is the benefit of this?
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.
less letters that basically do the same thing
i use unwrap
always during testing as this is the fastest way to get to results
assert_eq!( | ||
line_count, expected_line_count, | ||
"Unexpected number of output lines" | ||
); | ||
} | ||
|
||
#[test] | ||
fn test_default_use_case_pyproject_list() { |
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.
we could parametrize these tests similar to https://github.com/Quantco/pixi-pack/blob/0601bafffdc0c71752c4e52503cfbd1ed6587cbe/tests/integration_test.rs#L362
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.
could we make the lockfile smaller (for example by only adding conda-deny
to pixi.toml
)?
adding 7k lines for a single test case is a bit much IMO 😅
Motivation
Using
conda-deny
for all but some environments in pixi projects is an often occurring use case.Instead of having to recount all environment names apart from e.g. "
lint
", theexclude-environment
field allows you to specify environments to ignore.Changes
Configurations like the following:
can now be simplified to:
Also: The integration tests prior to this PR were quite forgiving. They are now a lot more stringent.