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

integration tests minor improvements #783

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

slimreaper35
Copy link
Member

Maintainers will complete the following section

  • Commit messages are descriptive enough
  • Code coverage from testing does not decrease and new code is covered
  • Docs updated (if applicable)
  • Docs links in the code are still valid (if docs were updated)

Note: if the contribution is external (not from an organization member), the CI
pipeline will not run automatically. After verifying that the CI is safe to run:

@@ -35,7 +35,7 @@
)
)
SUPPORTED_PMS: frozenset[str] = frozenset(
list(resolver._package_managers) + list(resolver._dev_package_managers)
list(resolver._package_managers) + list(resolver._dev_package_managers) + ["yarn_classic"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets the job done although I wonder if we could improve things a little by enclosing it in a variable called extra to make it more explicit that this is an unusual case.

Ultimately we might need to rename SUPPORTED_PMS to something else if the solution will need to consider other data beyond the PM scope (currently such changes run all integration tests), but that is out of scope for this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean something like this ?

SUPPORTED_PMS = list(resolver._package_managers)
DEV_PMS = list(resolver._dev_package_managers)
EXTRA_PMS = ["yarn_classic"]

ALL_PMS: frozenset[str] = frozenset(SUPPORTED_PMS + DEV_PMS + EXTRA_PMS)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty much, except that ALL_PMS would be named something else, e.g. TRACKED_DIRS or something more descriptive once you leave the realm of only wanting to filter tests solely based on actual pkg mgr backends. Like I said, we don't need to do that part now since we only have a single representative for the "extra" part so that would suffice :) .

`yarn` and `yarn classic` are used interchangeably for cachi2 requests
-> only `yarn` is among supported package managers

Our functionality for integration tests skips those not affected by
certain package manager. Since `yarn classic` is not a valid name as a
supported package manager, integration tests were never skipped, becuase
these are marked as `test_yarn_classic...` in a separate module.

Signed-off-by: Michal Šoltis <[email protected]>
Currently, the `nox -s generate-test-data` runs only on tests marked as
e2e because of passing the `PYTEST_ADDOPTS` env variable. This was
unfortunately implemented based on my wrong assumption that only e2e
tests with docker builds generate SBOM.

Fix the command and run all integration tests when someone wants to
regenerate test data based on their changes.

Signed-off-by: Michal Šoltis <[email protected]>
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.

3 participants