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

Mock GitHub input data in unit test in GitHub Actions #3434

Open
hamidonos opened this issue Sep 18, 2024 · 0 comments
Open

Mock GitHub input data in unit test in GitHub Actions #3434

hamidonos opened this issue Sep 18, 2024 · 0 comments

Comments

@hamidonos
Copy link
Collaborator

hamidonos commented Sep 18, 2024

Situation

In our unit tests, we currently do not mock GitHub input consistently, even when it is not within the scope of the specific test being conducted. This leads to unnecessary dependencies on GitHub input, which can complicate testing and potentially introduce issues unrelated to the actual code under test. For example, in the project name resolver test, the GitHub input is not part of the logic being tested but is still present, which could lead to false failures or distractions during testing.

Wanted

We need to mock every instance of GitHub input in our unit tests where it is not relevant to the scope of the test. By doing this, we can reduce unnecessary dependencies and ensure that our unit tests focus solely on the logic under test. This will improve test reliability, make the tests easier to maintain, and ensure they are faster and less prone to failure due to unrelated input.

Note

This might automatically resolve the flaky GitHub Actions Pipeline runs

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

No branches or pull requests

1 participant