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

test: unit test incompatible environments #1234

Merged
merged 5 commits into from
Mar 27, 2024
Merged

test: unit test incompatible environments #1234

merged 5 commits into from
Mar 27, 2024

Conversation

mkenigs
Copy link
Contributor

@mkenigs mkenigs commented Mar 26, 2024

Currently integration tests cover catching pkgdb build errors when a
manifest does not support the current system, or a package does not
support the current system. These cases will be faster and more targeted
if unit tested instead of integration tested.

Dropping integration tests will be done in a followup PR.

Writing these tests revealed there's currently no easy way to avoid a pkgdb scrape in a unit test and use an isolated flox instance, so the following changes were made as well:

  • Add a test_helpers module with flox_instance_with_global_lock that
    ensures pkgdb scrape has been run and then adds a global lock to the
    flox instance being created.
  • Move flox_instance to the test_helpers module
  • Drop FLOX_INSTANCE in favor of flox_instance_with_global_lock. Using a
    single FLOX_INSTANCE is likely to cause problems when shared between
    multiple tests because it doesn't isolate tests.
    flox_instance_with_global_lock will be close to as performant with
    better isolation.

Currently integration tests cover catching pkgdb build errors when a
manifest does not support the current system, or a package does not
support the current system. These cases will be faster and more targeted
if unit tested instead of integration tested.
- Add a test_helpers module with flox_instance_with_global_lock that
  ensures pkgdb scrape has been run and then adds a global lock to the
  flox instance being created.
- Move flox_instance to the test_helpers module
- Drop FLOX_INSTANCE in favor of flox_instance_with_global_lock. Using a
  single FLOX_INSTANCE is likely to cause problems when shared between
  multiple tests because it doesn't isolate tests.
  flox_instance_with_global_lock will be close to as performant with
  better isolation.
@mkenigs mkenigs requested a review from zmitchell March 27, 2024 15:46
@mkenigs mkenigs enabled auto-merge March 27, 2024 15:47
@mkenigs mkenigs added this pull request to the merge queue Mar 27, 2024
Merged via the queue into main with commit 7f3ee23 Mar 27, 2024
14 checks passed
@mkenigs mkenigs deleted the flox_instance branch March 27, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants