generated from actions/container-action
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Enable tests to run without a GitHub personal access token #87
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
johnboyes
commented
Jul 16, 2020
•
edited
Loading
edited
- Document how to contribute to the project:
- how to run the tests
This ensures that if/when we have a need to store test data permanently in the `testdata` directory (e.g. for mocks), the `testdata` directory won't be inadvertently deleted.
johnboyes
added
the
major
Semantic versioning: new functionality that is not backwards compatible
label
Jul 16, 2020
johnboyes
force-pushed
the
mock-github-test
branch
15 times, most recently
from
July 16, 2020 13:23
a933e8c
to
6da5d4d
Compare
This means that we no longer need to provide a GitHub `INPUT_REPO_TOKEN` environment variable when running the tests (fixes #85). The tests now use Hoverfly[1] by default, which proxies the calls to the GitHub API and returns simulated responses[2] instead. Also used Hoverfly to capture[3] these simulated responses. The tests can also be run with an -integration flag, which means they will make calls to the real GitHub API, requring a GitHub `INPUT_REPO_TOKEN` environment variable to have been set. Steps to install Hoverfly locally (you must do this on your local machine before you can run the tests): 1. Install Hoverfly[4] 2. Download the Hoverfly default cert[5] 3. Add and trust the Hoverfly default cert[6] (how to add and trust a cert)[7] [1] https://docs.hoverfly.io/ [2] https://docs.hoverfly.io/en/latest/pages/keyconcepts/simulations/simulations.html [3] https://docs.hoverfly.io/en/latest/pages/keyconcepts/modes/capture.html [4] https://docs.hoverfly.io/en/latest/pages/introduction/downloadinstallation.html [5] https://raw.githubusercontent.com/SpectoLabs/hoverfly/master/core/cert.pem [6] https://docs.hoverfly.io/en/latest/pages/tutorials/advanced/configuressl/configuressl.html [7] https://manuals.gfi.com/en/kerio/connect/content/server-configuration/ssl-certificates/adding-trusted-root-certificates-to-the-server-1605.html
The original captured GitHub API responses were gzip encoded, which made them unreadable (without manually decoding them). There is a feature request to have Hoverfly to do this translation automatically when exporting captured simulations, but it is not available yet[1]. So this commit has manually placed the decoded JSON in the simulated responses. [1] SpectoLabs/hoverfly#787
Update the GitHub Action to run the tests in both default mode (with virtualised service calls), and integration mode (with calls to the real GitHub API).
Also added and trusted the Hoverfly default certificate[1], so that Hoverfly https calls work And also set the tests to run in verbose mode in Visual Studio Code, so we get more informative output when running them. [1] https://raw.githubusercontent.com/SpectoLabs/hoverfly/master/core/cert.pem https://hoverfly.readthedocs.io/
johnboyes
force-pushed
the
mock-github-test
branch
9 times, most recently
from
July 20, 2020 06:49
02e2e6b
to
31684d1
Compare
johnboyes
force-pushed
the
mock-github-test
branch
7 times, most recently
from
July 20, 2020 07:42
c6c85a8
to
7b0cb9d
Compare
johnboyes
force-pushed
the
mock-github-test
branch
from
July 20, 2020 07:46
7b0cb9d
to
b5b8f7f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.