Skip to content

Commit 7dfe261

Browse files
committed
Reorganize test structure: move integration tests into subdirectory
Consolidates integration tests under tests/integration/ with updated paths in documentation, CI workflows, and configuration files. Improves project organization by clearly separating integration test artifacts.
1 parent 684509c commit 7dfe261

29 files changed

Lines changed: 418 additions & 358 deletions

.github/CI.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ uv sync --extra dev
2828
uv run mypy src/
2929

3030
# Middleware unit tests (no database required)
31-
uv run python tests/middleware_transport_tests.py
31+
uv run python tests/integration/middleware_transport_tests.py
3232

3333
# HTTP transport smoke test (no database required)
34-
uv run python tests/smoke_http.py --verbose
34+
uv run python tests/integration/smoke_http.py --verbose
3535

3636
# Integration tests — stdio (requires a live Teradata connection)
3737
export DATABASE_URI="teradata://user:pass@host:1025/database"
38-
uv run python tests/run_mcp_tests.py "uv run teradata-mcp-server"
38+
uv run python tests/integration/run_mcp_tests.py "uv run teradata-mcp-server"
3939

4040
# Integration tests — streamable-http (requires a live Teradata connection)
4141
export DATABASE_URI="teradata://user:pass@host:1025/database"
42-
uv run python tests/run_mcp_tests.py "uv run teradata-mcp-server" --transport streamable-http
42+
uv run python tests/integration/run_mcp_tests.py "uv run teradata-mcp-server" --transport streamable-http
4343
```
4444

4545
### Configuring the `DATABASE_URI` Secret

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ jobs:
5353
python-version: "3.11"
5454
- run: uv sync --frozen
5555
- name: Run middleware unit tests (no database required)
56-
run: uv run python tests/middleware_transport_tests.py
56+
run: uv run python tests/integration/middleware_transport_tests.py
5757
- name: Run HTTP smoke test (no database required)
58-
run: uv run python tests/smoke_http.py --verbose
58+
run: uv run python tests/integration/smoke_http.py --verbose
5959

6060
test-stdio:
6161
name: Integration Tests (stdio)
@@ -74,7 +74,7 @@ jobs:
7474
if: ${{ env.DATABASE_URI != '' }}
7575
env:
7676
DATABASE_URI: ${{ secrets.DATABASE_URI }}
77-
run: uv run python tests/run_mcp_tests.py "uv run teradata-mcp-server"
77+
run: uv run python tests/integration/run_mcp_tests.py "uv run teradata-mcp-server"
7878
- name: Warn if DATABASE_URI not configured
7979
if: ${{ env.DATABASE_URI == '' }}
8080
env:
@@ -98,7 +98,7 @@ jobs:
9898
if: ${{ env.DATABASE_URI != '' }}
9999
env:
100100
DATABASE_URI: ${{ secrets.DATABASE_URI }}
101-
run: uv run python tests/run_mcp_tests.py "uv run teradata-mcp-server" --transport streamable-http
101+
run: uv run python tests/integration/run_mcp_tests.py "uv run teradata-mcp-server" --transport streamable-http
102102
- name: Warn if DATABASE_URI not configured
103103
if: ${{ env.DATABASE_URI == '' }}
104104
env:

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ uv run mypy src/
3333

3434
# Run tests (requires a live Teradata connection)
3535
export DATABASE_URI="teradata://user:pass@host:1025/database"
36-
uv run python tests/run_mcp_tests.py "uv run teradata-mcp-server"
36+
uv run python tests/integration/run_mcp_tests.py "uv run teradata-mcp-server"
3737

3838
# Docker
3939
docker compose up teradata-mcp-server
@@ -104,7 +104,7 @@ For stdio transport, logs go to file only (to avoid polluting MCP stdout). Log l
104104

105105
### Testing
106106

107-
Tests require a live Teradata database. Test cases are JSON files in `tests/cases/` (e.g., `core_test_cases.json`). The test runner (`tests/run_mcp_tests.py`) dynamically discovers available tools and only runs matching test cases. Results are saved as timestamped JSON in `var/test-reports/`.
107+
Tests require a live Teradata database. Test cases are JSON files in `tests/integration/cases/` (e.g., `core_test_cases.json`). The test runner (`tests/integration/run_mcp_tests.py`) dynamically discovers available tools and only runs matching test cases. Results are saved as timestamped JSON in `var/test-reports/`.
108108

109109
## Code Conventions
110110

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* File: evals_employees_DDL.sql
3+
* Generated: 2026-06-23 14:16:55
4+
* Type: TABLE
5+
* Database: demo_user
6+
* Object: evals_employees
7+
* Size: 572 characters
8+
*/
9+
10+
CREATE SET TABLE demo_user.evals_employees ,FALLBACK ,
11+
NO BEFORE JOURNAL,
12+
NO AFTER JOURNAL,
13+
CHECKSUM = DEFAULT,
14+
DEFAULT MERGEBLOCKRATIO,
15+
MAP = TD_MAP1
16+
(
17+
employee_id INTEGER NOT NULL,
18+
name VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
19+
department VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
20+
salary DECIMAL(10,2),
21+
region VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
22+
hire_date DATE FORMAT 'YY/MM/DD' NOT NULL,
23+
manager_id INTEGER,
24+
PRIMARY KEY ( employee_id ))
25+
;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* File: evals_orders_DDL.sql
3+
* Generated: 2026-06-23 14:16:30
4+
* Type: TABLE
5+
* Database: demo_user
6+
* Object: evals_orders
7+
* Size: 563 characters
8+
*/
9+
10+
CREATE SET TABLE demo_user.evals_orders ,FALLBACK ,
11+
NO BEFORE JOURNAL,
12+
NO AFTER JOURNAL,
13+
CHECKSUM = DEFAULT,
14+
DEFAULT MERGEBLOCKRATIO,
15+
MAP = TD_MAP1
16+
(
17+
order_id INTEGER NOT NULL,
18+
customer_name VARCHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
19+
order_date DATE FORMAT 'YY/MM/DD' NOT NULL,
20+
ship_date DATE FORMAT 'YY/MM/DD',
21+
amount DECIMAL(10,2) NOT NULL,
22+
product_category VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
23+
quantity INTEGER NOT NULL,
24+
PRIMARY KEY ( order_id ))
25+
;

docs/developer_guide/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Make sure you have setup your environment based on the Developer Guide in this r
77
## Development Guidelines
88
- Always engage on the discussion board or create an issue before creating a PR.
99
- All PRs must have at least one issue associated.
10-
- Run the full pre-push checklist before opening a PR, and copy/paste the test report output in the PR: lint (`uv run ruff check src/`), type check (`uv run mypy src/`), HTTP smoke test (`uv run python tests/smoke_http.py`), and integration tests over both stdio and HTTP (`uv run python tests/run_mcp_tests.py "uv run teradata-mcp-server"` and `... --transport streamable-http`). See the [Developer Guide](./DEVELOPER_GUIDE.md) for the full ordered checklist.
11-
- Create a new test case if you add a new tool. For more information see [our testing guide](/tests/README.md)
10+
- Run the full pre-push checklist before opening a PR, and copy/paste the test report output in the PR: lint (`uv run ruff check src/`), type check (`uv run mypy src/`), HTTP smoke test (`uv run python tests/integration/smoke_http.py`), and integration tests over both stdio and HTTP (`uv run python tests/integration/run_mcp_tests.py "uv run teradata-mcp-server"` and `... --transport streamable-http`). See the [Developer Guide](./DEVELOPER_GUIDE.md) for the full ordered checklist.
11+
- Create a new test case if you add a new tool. For more information see [our testing guide](/tests/integration/README.md)
1212
- All code must be reviewed via a pull request. Before anything can be merged, it must be reviewed by at least 2 others. [Contributing to a project step by step instuctions](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project)
1313
- Squash commits into a single commit for your PR. We want to keep a clean git history.
1414
- Code should adhere to lint and codestyle tests. While you can commit code that doesn't validate but still works, it is encouraged to validate your code. It saves other's headaches down the road.

docs/developer_guide/DEVELOPER_GUIDE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ uv run mypy src/
5252
# 3. HTTP transport smoke test (no database required)
5353
# Catches startup-time errors in HTTP-specific code paths (middleware,
5454
# imports, constructor errors) that the stdio suite cannot reach.
55-
uv run python tests/smoke_http.py --verbose
55+
uv run python tests/integration/smoke_http.py --verbose
5656

5757
# 4. Integration tests — stdio (requires DATABASE_URI)
5858
export DATABASE_URI="teradata://user:pass@host:1025/database"
59-
uv run python tests/run_mcp_tests.py "uv run teradata-mcp-server"
59+
uv run python tests/integration/run_mcp_tests.py "uv run teradata-mcp-server"
6060

6161
# 5. Integration tests — streamable-http (requires DATABASE_URI)
62-
uv run python tests/run_mcp_tests.py "uv run teradata-mcp-server" --transport streamable-http
62+
uv run python tests/integration/run_mcp_tests.py "uv run teradata-mcp-server" --transport streamable-http
6363
```
6464

6565
Steps 1–3 have no database dependency and are quick — run them on every change. Steps 4–5 require VPN and credentials; run them when you have changed tool handlers, middleware, or connection logic.
@@ -650,18 +650,18 @@ Use the provided testing tool to run tests, add tests if you add a new tool.
650650

651651
We have a "core" test suite for all the core tools provided with this server, separate ones for the add-ons (eg. Enterprise Feature Store, Enterprise Vector Store) and you can add more for your custom tools.
652652

653-
See guidelines and details in [our testing guide](/tests/README.md)
653+
See guidelines and details in [our testing guide](/tests/integration/README.md)
654654

655655
Run testing before PR, and copy/paste the test report status in the PR.
656656

657657
**Development testing:**
658658
```bash
659-
python tests/run_mcp_tests.py "uv run teradata-mcp-server"
659+
python tests/integration/run_mcp_tests.py "uv run teradata-mcp-server"
660660
```
661661

662662
**Installed package testing:**
663663
```bash
664-
python tests/run_mcp_tests.py "teradata-mcp-server"
664+
python tests/integration/run_mcp_tests.py "teradata-mcp-server"
665665
```
666666

667667
<br><br><br>

docs/developer_guide/PROGRESSIVE_DISCLOSURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ All existing tests continue to work:
249249

250250
```bash
251251
export DATABASE_URI="teradata://user:pass@host:1025/database"
252-
uv run python tests/run_mcp_tests.py "uv run teradata-mcp-server"
252+
uv run python tests/integration/run_mcp_tests.py "uv run teradata-mcp-server"
253253
```
254254

255255
## Benefits

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ ignore = [
124124

125125
[tool.ruff.lint.per-file-ignores]
126126
"*/__init__.py" = ["F403", "F401"] # Allow wildcard imports and unused imports in __init__.py
127-
"tests/*" = ["F401", "F403", "PLR0913"] # More lenient for test files
127+
"tests/**" = ["F401", "F403", "PLR0913"] # More lenient for test files
128128

129129
[tool.ruff.lint.isort]
130130
known-first-party = ["teradata_mcp_server"]

0 commit comments

Comments
 (0)