Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4ec4b16

Browse filesBrowse files
committed
Update contributing.md for more clarity
1 parent f2b4de7 commit 4ec4b16
Copy full SHA for 4ec4b16

File tree

Expand file treeCollapse file tree

1 file changed

+18
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+18
-6
lines changed

‎CONTRIBUTING.md

Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+18-6Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,37 @@ Example for a single test case:
3131

3232
`WireMockStatusReporterTest: GitHub proxying and user auth correctly configured for user login: <your login>`
3333

34-
Whenever you run tests with `-Dtest.github.useProxy`, they will try to get data from local files but will fallback to proxying to github if not found.
35-
34+
Whenever you run tests with `-Dtest.github.useProxy`, they will try to get data from local files but will fallback to proxying to GitHub if not found.
3635

3736
### Writing a new test
3837

3938
Once you have credentials setup, you add new test classes and test methods as you would normally.
4039

41-
Keep `useProxy` enabled and iterate on your tests as needed. Remember, while proxying your tests are interacting with GitHub - you will need
42-
to clean up your state between runs. The following additional system property to enable testing using your personal github account.
40+
#### Running tests using GitHub test proxy
41+
42+
Keep `useProxy` enabled and iterate on your tests as needed. With `useProxy` enabled your tests will interact with
43+
GitHub - you will need to clean up your server-state between runs. This can be done manually to start with.
44+
Once your test code is somewhat stable, use `getGitHubBeforeAfter()` to get a `GitHub` instance for test setup and cleanup.
45+
Interactions with that `GitHub` instance will not be recorded as part of the test, keeping the test data files to a minimum.
46+
47+
#### Running tests against your personal GitHub user account
48+
49+
By default, test helper methods such as `getTempRepository()` target the `hub4j-test-org` GitHub organization.
50+
Please request access to this org to record your tests before submitting a PR. This helps keep the project stable and nimble.
51+
Until you have access (or if you don't want access), you can set the following additional system property to target
52+
your personal github account.
4353

4454
`mvn install -Dtest.github.org=false -Dtest=YourTestClassName`
4555

56+
#### Taking a snapshot
57+
4658
When you are ready to create a snapshot of your test data, run your test with `test.github.takeSnapshot` ("-Dtest.github.takeSnapshot" as
4759
a Java VM option). For example:
4860

4961
`mvn install -Dtest.github.takeSnapshot -Dtest.github.org=false -Dtest=YourTestClassName`
5062

51-
The above command would create snapshot WireMock data files under the path `src/test/resources/org/kohsuhke/github/YourTestClassName/wiremock`.
52-
Each method would get a separate director that would hold the data files for that test method.
63+
The above command will create snapshot WireMock data files under the path `src/test/resources/org/kohsuhke/github/YourTestClassName/wiremock`.
64+
Each method will get a separate directory that will hold the data files for that test method.
5365

5466
Add all files including the generated data to your commit and submit a PR.
5567

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.