-
Notifications
You must be signed in to change notification settings - Fork 25
ci: Add CI testing for markdown-based end-to-end tests #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
57df89b
feat: modular doc_e2e_tests framework in basic_end_to_end
ganeshku1 6bb0549
feat: complete modular doc_e2e_tests framework
ganeshku1 3ffb68b
test commit: update start_server.sh to use main.py --all-servers
ganeshku1 d060b09
chore: cleanup basic e2e and test docs e2e tests, remove README skip …
lkomali ecb501b
fix: Fix comments
lkomali 7bbd8c0
Remove basic_end_to_end_test
lkomali 0d8fccc
Merge branch 'main' into e2e-doc-test
ganeshku1 f0e4962
Merge branch 'main' into e2e-doc-test
ganeshku1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| """ | ||
| Constants for the end-to-end testing framework. | ||
| """ | ||
|
|
||
| # Tag patterns | ||
| SETUP_TAG_PREFIX = "setup-" | ||
| HEALTH_CHECK_TAG_PREFIX = "health-check-" | ||
| AIPERF_RUN_TAG_PREFIX = "aiperf-run-" | ||
| TAG_SUFFIX = "endpoint-server" | ||
|
|
||
| # Tag lengths for parsing | ||
| SETUP_TAG_PREFIX_LEN = len(SETUP_TAG_PREFIX) | ||
| HEALTH_CHECK_TAG_PREFIX_LEN = len(HEALTH_CHECK_TAG_PREFIX) | ||
| AIPERF_RUN_TAG_PREFIX_LEN = len(AIPERF_RUN_TAG_PREFIX) | ||
| TAG_SUFFIX_LEN = len(TAG_SUFFIX) | ||
|
|
||
| # AIPerf execution | ||
| AIPERF_UI_TYPE = "simple" | ||
|
|
||
| # Timeouts | ||
| SETUP_MONITOR_TIMEOUT = 30 # seconds to monitor setup output | ||
| CONTAINER_BUILD_TIMEOUT = 600 # seconds for Docker build | ||
| CONTAINER_START_TIMEOUT = 60 # seconds for container startup | ||
| AIPERF_COMMAND_TIMEOUT = 300 # seconds for AIPerf commands |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| """ | ||
| Data models for the end-to-end testing framework. | ||
| """ | ||
|
|
||
| from dataclasses import dataclass | ||
|
|
||
|
|
||
| @dataclass | ||
| class Command: | ||
| """Represents a command extracted from markdown""" | ||
|
|
||
| tag_name: str | ||
| command: str | ||
| file_path: str | ||
| start_line: int | ||
| end_line: int | ||
|
|
||
|
|
||
| @dataclass | ||
| class Server: | ||
| """Represents a server with its setup, health check, and aiperf commands""" | ||
|
|
||
| name: str | ||
| setup_command: Command | None | ||
| health_check_command: Command | None | ||
| aiperf_commands: list[Command] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| #!/usr/bin/env python3 | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| """ | ||
| Simple end-to-end test tool for AIPerf documentation. | ||
| Parses markdown files for server setup and AIPerf run commands, | ||
| builds AIPerf container, and executes tests. | ||
| """ | ||
|
|
||
| import logging | ||
| import sys | ||
|
|
||
| from parser import MarkdownParser | ||
| from test_runner import TestRunner | ||
| from utils import get_repo_root, setup_logging | ||
|
|
||
| # Configure logging using centralized utility | ||
| setup_logging() | ||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def main(): | ||
| """Main function""" | ||
| import argparse | ||
|
|
||
| parser = argparse.ArgumentParser( | ||
| description="Run end-to-end tests from markdown documentation" | ||
| ) | ||
| parser.add_argument( | ||
| "--dry-run", | ||
| action="store_true", | ||
| help="Show discovered commands without executing", | ||
| ) | ||
| parser.add_argument( | ||
| "--all-servers", | ||
| action="store_true", | ||
| help="Run tests for all discovered servers", | ||
| ) | ||
| args = parser.parse_args() | ||
|
|
||
| # Get repository root using centralized function | ||
| repo_root = get_repo_root() | ||
|
|
||
| # Parse markdown files | ||
| md_parser = MarkdownParser() | ||
| servers = md_parser.parse_directory(str(repo_root)) | ||
|
|
||
| if not servers: | ||
| logger.warning("No servers found") | ||
| return 0 | ||
|
|
||
| logger.info(f"Discovered {len(servers)} servers:") | ||
| for name, server in servers.items(): | ||
| setup_file = ( | ||
| server.setup_command.file_path if server.setup_command else "MISSING" | ||
| ) | ||
| health_file = ( | ||
| server.health_check_command.file_path | ||
| if server.health_check_command | ||
| else "MISSING" | ||
| ) | ||
| aiperf_count = len(server.aiperf_commands) | ||
| logger.info( | ||
| f" {name}: setup={setup_file}, health={health_file}, aiperf_commands={aiperf_count}" | ||
| ) | ||
|
|
||
debermudez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if args.dry_run: | ||
| logger.info("Dry run completed") | ||
| return 0 | ||
|
|
||
| # Run tests | ||
| runner = TestRunner() | ||
| success = runner.run_tests(servers) | ||
|
|
||
| if success: | ||
| logger.info("All tests passed!") | ||
| return 0 | ||
| else: | ||
| logger.error("Some tests failed") | ||
| return 1 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| sys.exit(main()) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.