Skip to content

Commit be06d5d

Browse files
Saranya-jenaHarness
authored andcommitted
chore: [ML-1303]: Update the readme and PR template for running e2e tests in mcp server (#117)
* chore: [ML-1303]: Update the readme and PR template for running e2e tests in mcp server Signed-off-by: Saranya-jena <[email protected]>
1 parent 5ceb25e commit be06d5d

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.harness/pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
- [ ] Error cases are properly handled and return appropriate error messages
8080
- [ ] Rate limiting and authentication work as expected
8181

82+
### E2E Test Verification
83+
- [ ] E2E tests added or not required (explain why if not required)
84+
8285
### Screenshot Verification
8386
- [ ] Screenshots are up-to-date with the current UI
8487
- [ ] Sensitive information is redacted from screenshots

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,3 +563,35 @@ npx @modelcontextprotocol/inspector /path/to/harness-mcp-server stdio
563563
```
564564

565565
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
566+
567+
## Testing
568+
569+
### Running E2E Tests
570+
571+
The project includes end-to-end (E2E) tests that validate the integration with Harness services. To run these tests:
572+
573+
1. Set up the required environment variables:
574+
575+
```bash
576+
export HARNESS_MCP_SERVER_E2E_TOKEN=<your_harness_api_token>
577+
export HARNESS_MCP_SERVER_E2E_ACCOUNT_ID=<your_account_id>
578+
export HARNESS_MCP_SERVER_E2E_ORG_ID=<your_org_id>
579+
export HARNESS_MCP_SERVER_E2E_PROJECT_ID=<your_project_id>
580+
export HARNESS_MCP_SERVER_E2E_BASE_URL=<base_url>
581+
```
582+
583+
2. Run the E2E tests using the Go test command with the e2e build tag:
584+
585+
```bash
586+
go test -tags=e2e ./test/e2e/... -v
587+
```
588+
589+
3. To run specific E2E tests, use the `-run` flag:
590+
591+
```bash
592+
go test -tags=e2e ./test/e2e/... -v -run TestPipelineWorkflow
593+
```
594+
595+
4. In VS Code, you can run the E2E tests directly using the launch.json configuration. Simply open the Run and Debug view, select the E2E test configuration from the dropdown menu, and click the Run button.
596+
597+
The E2E tests create an in-process MCP client that communicates with the Harness API using your provided credentials.

0 commit comments

Comments
 (0)