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 (search) #1432

Open
mkenigs opened this issue May 9, 2024 · 1 comment
Open

set catalog feature flag for integration tests (search) #1432

mkenigs opened this issue May 9, 2024 · 1 comment
Labels
team-cli Tickets relevant to the flox CLI team
Milestone

Comments

@mkenigs
Copy link
Contributor

mkenigs commented May 9, 2024

Do some combination of:

  • Copy tests in search.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
  • Port those tests to unit tests run with the catalog feature set
  • Port those tests to serverside tests

In any case:

  • 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
@mkenigs mkenigs added this to the Catalog 3 milestone May 9, 2024
@mkenigs mkenigs added the team-cli Tickets relevant to the flox CLI team label May 9, 2024
@zmitchell
Copy link
Contributor

Most of these tests can be converted into unit tests without much effort since we have the ability to seed the client with mock data.

Additional context:

  • We have tests that use different search strategies. We no longer have multiple search strategies as far as I can tell, so you'll have to dedup those tests.
  • I don't know that the tests verifying the number of results will be very meaningful given that you're seeding the catalog client with test data. At best this is simply verifying that all the results obtained by the client appear in the search output.
  • I'm not sure how we propose to test the semver handling since that's now server-side. Semver filtering now only happens on the /resolve endpoint, so those tests should likely be moved elsewhere.
  • "'flox search' error message when no results" could be turned into a unit test that detects whether Search::handle returns an error whose .description method contains the desired error message.
  • We could refactor the "show results" functions to take impl Write instances instead of assuming stdout/stderr. This lets you pass in buffers during testing, which could be useful for counting search results and verifying that certain error messages are printed.
  • There are tests that verify certain packages are in the package database. With catalog service up and running these likely belong in that test suite rather than flox/flox.

@zmitchell zmitchell assigned zmitchell and unassigned zmitchell May 24, 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

2 participants