Skip to content

Commit 460f344

Browse files
committed
chore: cleanup basic e2e and test docs e2e tests, remove README skip section
1 parent 4e322ff commit 460f344

File tree

11 files changed

+344
-225
lines changed

11 files changed

+344
-225
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
echo "Starting dynamo server with model ${MODEL}"
6+
7+
bash -x ${AIPERF_SOURCE_DIR}tests/ci/${CI_JOB_NAME}/start_server.sh
8+
9+
echo "Running aiperf functionality tests in container"
10+
11+
docker run \
12+
--rm \
13+
--gpus all \
14+
--network host \
15+
-w /aiperf \
16+
-v ${AIPERF_SOURCE_DIR}:/aiperf \
17+
-e CI_JOB_NAME=${CI_JOB_NAME} \
18+
-e MODEL=${MODEL} \
19+
ubuntu:24.04 /bin/bash -x /aiperf/tests/ci/common/setup_aiperf.sh

tests/ci/basic_end_to_end/start_server.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44

5-
# This script now uses the main.py --all-servers approach
6-
# instead of manually starting servers
7-
85
set -x
96

10-
echo "Starting end-to-end documentation tests using main.py --all-servers"
7+
time docker pull ${DYNAMO_PREBUILT_IMAGE_TAG}
8+
9+
DYNAMO_REPO_TAG=$(docker run --rm --entrypoint "" ${DYNAMO_PREBUILT_IMAGE_TAG} cat /workspace/version.txt | cut -d'+' -f2)
10+
11+
curl -O https://raw.githubusercontent.com/ai-dynamo/dynamo/${DYNAMO_REPO_TAG}/deploy/docker-compose.yml
1112

12-
# Navigate to the test directory
13-
cd "$(dirname "$0")"
13+
docker compose -f docker-compose.yml down || true
1414

15-
# Execute the main.py script with --all-servers flag
16-
python3 main.py --all-servers
15+
docker compose -f docker-compose.yml up -d
1716

18-
echo "End-to-end documentation tests completed"
17+
docker run \
18+
--rm \
19+
--gpus all \
20+
--network host \
21+
${DYNAMO_PREBUILT_IMAGE_TAG} \
22+
/bin/bash -c "python3 -m dynamo.frontend & python3 -m dynamo.vllm --model ${MODEL} --enforce-eager --no-enable-prefix-caching" > ${AIPERF_SOURCE_DIR}/server.log 2>&1 &

tests/ci/basic_end_to_end/test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
# TODO: switch to the commented code when dynamo 0.4.1 is released
6-
# timeout 5m /bin/bash -c 'while ! curl -s localhost:8080/v1/models | jq -en "input | (.data // []) | length > 0" > /dev/null 2>&1; do sleep 1; done'
7-
timeout 5m /bin/bash -c 'while [ "$(curl -s -o /dev/null -w "%{http_code}" localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '"'"'{"model":"Qwen/Qwen3-0.6B","messages":[{"role":"user","content":"a"}],"max_completion_tokens":1}'"'"')" != "200" ]; do sleep 1; done'
6+
# timeout 5m /bin/bash -c 'while ! curl -s localhost:8000/v1/models | jq -en "input | (.data // []) | length > 0" > /dev/null 2>&1; do sleep 1; done'
7+
timeout 5m /bin/bash -c 'while [ "$(curl -s -o /dev/null -w "%{http_code}" localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '"'"'{"model":"Qwen/Qwen3-0.6B","messages":[{"role":"user","content":"a"}],"max_completion_tokens":1}'"'"')" != "200" ]; do sleep 1; done'
88

99
if [ $? -eq 124 ]; then
1010
echo -e "\033[0;36m╔════════════════════════════════════════╗\033[0m"
@@ -23,7 +23,7 @@ echo -e "\033[0;36m╔═══════════════════
2323
echo -e "\033[0;36m║ *** AIPERF LOG *** ║\033[0m"
2424
echo -e "\033[0;36m╚════════════════════════════════════════╝\033[0m"
2525

26-
timeout 5m aiperf profile --model-names ${MODEL} -u localhost:8080 --concurrency 100 --request-count 300
26+
timeout 5m aiperf profile --model-names ${MODEL} -u localhost:8000 --concurrency 100 --request-count 300
2727

2828
EXIT_CODE=$?
2929

@@ -49,4 +49,4 @@ elif [ ${EXIT_CODE} -ne 0 ]; then
4949
echo -e "\033[0;31m║ See aiperf and server logs above ║\033[0m"
5050
echo -e "\033[0;31m╚════════════════════════════════════════╝\033[0m"
5151
exit 1
52-
fi
52+
fi

tests/ci/basic_end_to_end/constants.py renamed to tests/ci/test_docs_end_to_end/constants.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
13
"""
24
Constants for the end-to-end testing framework.
35
"""
@@ -20,5 +22,5 @@
2022
# Timeouts
2123
SETUP_MONITOR_TIMEOUT = 30 # seconds to monitor setup output
2224
CONTAINER_BUILD_TIMEOUT = 600 # seconds for Docker build
23-
CONTAINER_START_TIMEOUT = 60 # seconds for container startup
24-
AIPERF_COMMAND_TIMEOUT = 300 # seconds for AIPerf commands
25+
CONTAINER_START_TIMEOUT = 60 # seconds for container startup
26+
AIPERF_COMMAND_TIMEOUT = 300 # seconds for AIPerf commands
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
13
"""
24
Data models for the end-to-end testing framework.
35
"""
46

57
from dataclasses import dataclass
6-
from typing import List, Optional
8+
79

810
@dataclass
911
class Command:
1012
"""Represents a command extracted from markdown"""
13+
1114
tag_name: str
1215
command: str
1316
file_path: str
1417
start_line: int
1518
end_line: int
1619

20+
1721
@dataclass
1822
class Server:
1923
"""Represents a server with its setup, health check, and aiperf commands"""
24+
2025
name: str
21-
setup_command: Optional[Command]
22-
health_check_command: Optional[Command]
23-
aiperf_commands: List[Command]
26+
setup_command: Command | None
27+
health_check_command: Command | None
28+
aiperf_commands: list[Command]
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/usr/bin/env python3
2+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
24
"""
35
Simple end-to-end test tool for AIPerf documentation.
46
57
Parses markdown files for server setup and AIPerf run commands,
68
builds AIPerf container, and executes tests.
79
"""
810

9-
import sys
1011
import logging
11-
from pathlib import Path
12+
import sys
1213

1314
from parser import MarkdownParser
1415
from test_runner import TestRunner
@@ -18,47 +19,67 @@
1819
setup_logging()
1920
logger = logging.getLogger(__name__)
2021

22+
2123
def main():
2224
"""Main function"""
2325
import argparse
24-
25-
parser = argparse.ArgumentParser(description="Run end-to-end tests from markdown documentation")
26-
parser.add_argument("--dry-run", action="store_true", help="Show discovered commands without executing")
27-
parser.add_argument("--all-servers", action="store_true", help="Run tests for all discovered servers")
26+
27+
parser = argparse.ArgumentParser(
28+
description="Run end-to-end tests from markdown documentation"
29+
)
30+
parser.add_argument(
31+
"--dry-run",
32+
action="store_true",
33+
help="Show discovered commands without executing",
34+
)
35+
parser.add_argument(
36+
"--all-servers",
37+
action="store_true",
38+
help="Run tests for all discovered servers",
39+
)
2840
args = parser.parse_args()
29-
41+
3042
# Get repository root using centralized function
3143
repo_root = get_repo_root()
32-
44+
3345
# Parse markdown files
3446
md_parser = MarkdownParser()
3547
servers = md_parser.parse_directory(str(repo_root))
36-
48+
3749
if not servers:
3850
logger.warning("No servers found")
3951
return 0
40-
52+
4153
logger.info(f"Discovered {len(servers)} servers:")
4254
for name, server in servers.items():
43-
setup_file = server.setup_command.file_path if server.setup_command else "MISSING"
44-
health_file = server.health_check_command.file_path if server.health_check_command else "MISSING"
55+
setup_file = (
56+
server.setup_command.file_path if server.setup_command else "MISSING"
57+
)
58+
health_file = (
59+
server.health_check_command.file_path
60+
if server.health_check_command
61+
else "MISSING"
62+
)
4563
aiperf_count = len(server.aiperf_commands)
46-
logger.info(f" {name}: setup={setup_file}, health={health_file}, aiperf_commands={aiperf_count}")
47-
64+
logger.info(
65+
f" {name}: setup={setup_file}, health={health_file}, aiperf_commands={aiperf_count}"
66+
)
67+
4868
if args.dry_run:
4969
logger.info("Dry run completed")
5070
return 0
51-
71+
5272
# Run tests
5373
runner = TestRunner()
5474
success = runner.run_tests(servers)
55-
75+
5676
if success:
5777
logger.info("All tests passed!")
5878
return 0
5979
else:
6080
logger.error("Some tests failed")
6181
return 1
6282

83+
6384
if __name__ == "__main__":
64-
sys.exit(main())
85+
sys.exit(main())

0 commit comments

Comments
 (0)