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

Add TestModules #10369

Merged
merged 2 commits into from
Feb 15, 2022
Merged

Add TestModules #10369

merged 2 commits into from
Feb 15, 2022

Conversation

jimbishopp
Copy link
Contributor

@jimbishopp jimbishopp commented Feb 15, 2022

This PR adds TestModules which allows tests to set fake values to be returned from modules.GetModules(). The pattern implemented is an extension of the pattern used when implementing #10355.

All tests that require test modules have been refactored to use this new implementation.

In some cases, multiple tests in the same package/file require the same features. In such cases, I opted to not create a separate function to set the features and instead inlined each call. Having the features visible in each test outweighed the benefit of saving a few lines of code.

Updates: #9492

@jimbishopp jimbishopp enabled auto-merge (squash) February 15, 2022 19:09
@github-actions github-actions bot added the database-access Database access related issues and PRs label Feb 15, 2022
@jimbishopp jimbishopp self-assigned this Feb 15, 2022
@jimbishopp jimbishopp marked this pull request as draft February 15, 2022 19:15
lib/modules/test.go Show resolved Hide resolved
@jimbishopp jimbishopp marked this pull request as ready for review February 15, 2022 19:33
lib/modules/test.go Show resolved Hide resolved
@jimbishopp jimbishopp merged commit 22e043c into master Feb 15, 2022
@jimbishopp jimbishopp deleted the jim/fixtestmodules branch February 15, 2022 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database-access Database access related issues and PRs flaky tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants