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

set catalog feature flag for integration tests (list) #1420

Closed
ghudgins opened this issue May 8, 2024 · 2 comments
Closed

set catalog feature flag for integration tests (list) #1420

ghudgins opened this issue May 8, 2024 · 2 comments
Assignees
Labels
team-cli Tickets relevant to the flox CLI team
Milestone

Comments

@ghudgins
Copy link
Contributor

ghudgins commented May 8, 2024

Either:

  • Copy any tests in list.bats that are impacted by the catalog and run them with the catalog feature flag set. Make any small changes required to get them passing

Or:

  • Port those tests to unit tests run with the catalog feature set

In both cases:

  • Set FLOX_FEATURES_USE_CATALOG=true and _FLOX_USE_CATALOG_MOCK=/dev/null for all other tests in the file
  • If anything that isn't minor breaks, skip copied tests and create followup tickets
@ghudgins ghudgins added the team-cli Tickets relevant to the flox CLI team label May 8, 2024
@ghudgins ghudgins modified the milestones: Catalog 2, Catalog 3 May 8, 2024
@mkenigs mkenigs added team-cli Tickets relevant to the flox CLI team and removed team-cli Tickets relevant to the flox CLI team labels May 9, 2024
@mkenigs
Copy link
Contributor

mkenigs commented May 20, 2024

Looks like the following should be unit tests:

  • 'flox list' lists packages of environment in the current dir; shows different paths
  • 'flox list' lists packages of environment in the current dir; shows different id
  • 'flox list' hides packages not installed for the current system
  • 'flox list' tolerates missing version

The following need to be modified to run with the catalog:

  • (this could be a unit test, but I think it's probably good to have at least one integration test for flox list?) 'flox list' lists packages of environment in the current dir; One package from nixpkgs

@ysndr ysndr self-assigned this Jun 7, 2024
@ysndr
Copy link
Contributor

ysndr commented Jun 7, 2024

what about these do we want to unit test though?
almost all of the current tests mostly check the output (formatting), the "installation side" (whether the right data goes into the manifest) of these tests is already covered in the .. install tests

so do we want to test

  • the formatters[1]
  • whether we convert the lockfile without information loss [2] (which in the catalog case is basically an image of LockedPackageCatalog only the pkgdb case does a bit more work there) or
  • whether filter systems correctly with .filter(|system| system == package.system)?

Further, we dont really have "missing versions" anymore as our scraping seems to default to the package name if no version is specified, that may be an upstream issue.

[1] https://github.com/flox/flox/blob/15171d5fa8366d81094ef41b67b770122f01c6c2/cli/flox/src/commands/list.rs#L106-L164

[2] https://github.com/flox/flox/blob/15171d5fa8366d81094ef41b67b770122f01c6c2/cli/flox-rust-sdk/src/models/lockfile.rs#L283-L304

@mkenigs mkenigs closed this as completed Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-cli Tickets relevant to the flox CLI team
Projects
None yet
Development

No branches or pull requests

3 participants