Skip to content

Commit 1badb27

Browse files
authored
docs: add testing tips for contributors (#25)
1 parent 1d878d4 commit 1badb27

1 file changed

Lines changed: 42 additions & 3 deletions

File tree

CONTRIBUTING.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,20 @@ nox -s format
4646

4747
## Test changes
4848

49-
To test changes, modify the `command` for the `analytics-mcp` entry in your
50-
`~/.gemini/settings.json` file so Gemini runs the server using your local
51-
source files.
49+
1. Add or update unit tests in the `tests` directory.
50+
51+
1. Run the unit tests for the supported Python versions that are available in
52+
your environment:
53+
54+
```
55+
nox -s tests*
56+
```
57+
58+
### Test using Gemini
59+
60+
To test changes by issuing prompts in Gemini, modify the `command` for the
61+
`analytics-mcp` entry in your `~/.gemini/settings.json` file so Gemini runs the
62+
server using your local source files.
5263
5364
Replace `PATH_TO_REPO` in the following snippet with the path where you cloned
5465
the repo:
@@ -57,3 +68,31 @@ the repo:
5768
"command": "PATH_TO_REPO/.venv/bin/google-analytics-mcp",
5869
```
5970
71+
When running the `gemini` command from a terminal, add the `--debug` option so
72+
Gemini outputs debug information as it processes prompts.
73+
74+
### Test from GitHub
75+
76+
After you push changes to GitHub, use `pipx` to run the server for a specific
77+
branch, and use the `--no-cache` option so `pipx` gets the
78+
latest changes.
79+
80+
Here's an example that runs the latest code from a branch named
81+
`awesome-feature-42` in this repo:
82+
83+
```json
84+
{
85+
"mcpServers": {
86+
"analytics-mcp": {
87+
"command": "pipx",
88+
"args": [
89+
"run",
90+
"--no-cache",
91+
"--spec",
92+
"git+https://github.com/googleanalytics/google-analytics-mcp.git@awesome-feature-42",
93+
"google-analytics-mcp"
94+
]
95+
}
96+
}
97+
}
98+
```

0 commit comments

Comments
 (0)