You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,12 +219,13 @@ docker run -i --rm \
219
219
ghcr.io/github/github-mcp-server
220
220
```
221
221
222
-
## GitHub Enterprise Server
222
+
## GitHub Enterprise Server and Enterprise Cloud with data residency (ghe.com)
223
223
224
224
The flag `--gh-host` and the environment variable `GITHUB_HOST` can be used to set
225
-
the GitHub Enterprise Server hostname.
226
-
Prefix the hostname with the `https://` URI scheme, as it otherwise defaults to `http://` which GitHub Enterprise Server does not support.
225
+
the hostname for GitHub Enterprise Server or GitHub Enterprise Cloud with data residency.
227
226
227
+
- For GitHub Enterprise Server, prefix the hostname with the `https://` URI scheme, as it otherwise defaults to `http://`, which GitHub Enterprise Server does not support.
228
+
- For GitHub Enterprise Cloud with data residency, use `https://YOURSUBDOMAIN.ghe.com` as the hostname.
228
229
```json
229
230
"github": {
230
231
"command": "docker",
@@ -240,7 +241,7 @@ Prefix the hostname with the `https://` URI scheme, as it otherwise defaults to
This project uses a combination of unit tests and end-to-end (e2e) tests to ensure correctness and stability.
4
+
5
+
## Unit Testing Patterns
6
+
7
+
- Unit tests are located alongside implementation, with filenames ending in `_test.go`.
8
+
- Currently the preference is to use internal tests i.e. test files do not have `_test` package suffix.
9
+
- Tests use [testify](https://github.com/stretchr/testify) for assertions and require statements. Use `require` when continuing the test is not meaningful, for example it is almost never correct to continue after an error expectation.
10
+
- Mocking is performed using [go-github-mock](https://github.com/migueleliasweb/go-github-mock) or `githubv4mock` for simulating GitHub rest and GQL API responses.
11
+
- Each tool's schema is snapshotted and checked for changes using the `toolsnaps` utility (see below).
12
+
- Tests are designed to be explicit and verbose to aid maintainability and clarity.
13
+
- Handler unit tests should take the form of:
14
+
1. Test tool snapshot
15
+
1. Very important expectations against the schema (e.g. `ReadOnly` annotation)
16
+
1. Behavioural tests in table-driven form
17
+
18
+
## End-to-End (e2e) Tests
19
+
20
+
- E2E tests are located in the [`e2e/`](../e2e/) directory. See the [e2e/README.md](../e2e/README.md) for full details on running and debugging these tests.
21
+
22
+
## toolsnaps: Tool Schema Snapshots
23
+
24
+
- The `toolsnaps` utility ensures that the JSON schema for each tool does not change unexpectedly.
25
+
- Snapshots are stored in `__toolsnaps__/*.snap` files , where `*` represents the name of the tool
26
+
- When running tests, the current tool schema is compared to the snapshot. If there is a difference, the test will fail and show a diff.
27
+
- If you intentionally change a tool's schema, update the snapshots by running tests with the environment variable: `UPDATE_TOOLSNAPS=true go test ./...`
28
+
- In CI (when `GITHUB_ACTIONS=true`), missing snapshots will cause a test failure to ensure snapshots are always
29
+
committed.
30
+
31
+
## Notes
32
+
33
+
- Some tools that mutate global state (e.g., marking all notifications as read) are tested primarily with unit tests, not e2e, to avoid side effects.
34
+
- For more on the limitations and philosophy of the e2e suite, see the [e2e/README.md](../e2e/README.md).
0 commit comments