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

feat: created mocks for tests #21

Merged
merged 5 commits into from
Oct 16, 2024
Merged

Conversation

csautter
Copy link
Contributor

The Pull Request #20 introduced integration tests against the real API. As requirement for a successful test run the env var EIA_TOKEN has to be available.
New Pull Requests from fork repositories are not able to access the EIA_TOKEN from the main repo neither the fork. This is a security feature of Github Actions.

  • To make the tests independent of an external API call this PR adds mocks of the API responses.
  • The tests are functional as independent Unit Tests with mocks or as integration test against the real API (just delete the mocks before test execution)
  • The mocks are easily extendible if the tests change
  • Github Actions is adjusted to use the mocked data in PRs from fork branches
  • a secret scanner was added to avoid accidentally adding request/response mocks with API keys

@csautter csautter marked this pull request as ready for review October 14, 2024 12:32
@csautter
Copy link
Contributor Author

@philsv i cannot investigate the reason for the failing snyk job (no access)

@philsv philsv merged commit 4a1a565 into philsv:main Oct 16, 2024
20 checks passed
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.

2 participants