Cvs 169692 enable on commit tests part iii - #4501
Open
ngrozae wants to merge 14 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
It introduces a CI command-injection risk in the new Jenkins pipeline and also has correctness/quality issues (duplicate method definition and a misspelled constant) that should be fixed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR enables the next tranche of “on-commit” functional tests and the supporting infrastructure/config to run them reliably across environments (local, CI, and reservation-managed hosts), including new GenAI endpoint coverage.
Changes:
- Adds new functional test suites for OpenAI-style embeddings and text generation, plus Cohere rerank endpoint coverage, along with model/library/dataset additions for LLM/VLM scenarios.
- Introduces/updates CI and developer workflows to run functional tests on commit (new Jenkins pipeline, on-commit detection, pylint stage, docs/Makefile adjustments).
- Performs broad test-framework refactors (pylint enablement, safer defaults, encoding fixes, small Python cleanups) to make functional tests runnable in CI.
File summaries
| File | Description |
|---|---|
| tests/requirements.txt | Bumps GitPython version used by tests. |
| tests/functional/utils/test_framework.py | Adds shared directory-copy helper (Windows robocopy + POSIX copytree). |
| tests/functional/utils/reservation_manager/unittests/test_manager.py | Pylint-related cleanup in reservation manager tests. |
| tests/functional/utils/reservation_manager/manager.py | Adds UTF-8 encoding to file IO; type-check improvements. |
| tests/functional/utils/reservation_manager/locker.py | Modernizes class declaration. |
| tests/functional/utils/process.py | Minor exception-variable cleanup; UTF-8 read_text; RemoteProcess init cleanup. |
| tests/functional/utils/port_manager.py | Import ordering/formatting tweaks. |
| tests/functional/utils/ov_hf_downloader.py | Improves log text for OpenVINO HuggingFace downloads. |
| tests/functional/utils/numpy_loader.py | Minor cleanup of unused vars and control flow. |
| tests/functional/utils/marks.py | Fixes super() usage; marker utilities cleanup. |
| tests/functional/utils/logger.py | Modernizes class declaration. |
| tests/functional/utils/log_monitor.py | Fixes mutable default args; small loop cleanups. |
| tests/functional/utils/inference/serving/triton.py | Pylint suppression + unused loop var cleanup. |
| tests/functional/utils/inference/serving/openai.py | Pylint suppression; minor dict construction tweak. |
| tests/functional/utils/inference/serving/kf.py | Uses isinstance checks; unused var cleanup. |
| tests/functional/utils/inference/serving/base.py | Removes redundant pass bodies for abstract methods. |
| tests/functional/utils/inference/communication/rest.py | Uses isinstance; removes unused locals. |
| tests/functional/utils/inference/communication/grpc.py | Adds pylint suppression. |
| tests/functional/utils/inference/communication/base.py | Removes redundant pass in abstract method. |
| tests/functional/utils/inference/capi.py | Adds pylint suppression. |
| tests/functional/utils/http/http_socket_wrapper.py | Fixes mutable default arg for headers. |
| tests/functional/utils/http/http_session.py | Modernizes class declaration. |
| tests/functional/utils/http/http_client.py | Modernizes class declaration. |
| tests/functional/utils/http/http_client_factory.py | Simplifies branching; modernizes class declaration. |
| tests/functional/utils/http/http_client_configuration.py | Modernizes class declaration; minor dict init cleanup. |
| tests/functional/utils/http/client_auth/base.py | Modernizes class declaration; removes redundant pass. |
| tests/functional/utils/http/client_auth/auth.py | Modernizes class declarations; refactors branching; minor dict init cleanup. |
| tests/functional/utils/http/base.py | Adds pylint suppression. |
| tests/functional/utils/hooks.py | Adds dmesg cleanup; airplane-mode skip; deselect logic extension; refactors imports/formatting. |
| tests/functional/utils/git_operations.py | Adds pylint suppression; unused exception var cleanup. |
| tests/functional/utils/docker.py | Adds UTF-8 file reads; converts format strings to f-strings; dict init cleanup. |
| tests/functional/utils/core.py | Adds UTF-8 read_text; exception-var cleanup; minor control-flow cleanup. |
| tests/functional/utils/context.py | Modernizes class declaration; annotates broad exception catch. |
| tests/functional/utils/assertions.py | Import ordering; UTF-8 read_text; small cleanup. |
| tests/functional/test_text_generation.py | New on-commit tests for text generation endpoints (LLM/VLM). |
| tests/functional/test_rerank.py | New on-commit + regression tests for rerank endpoint (Cohere-style). |
| tests/functional/test_embeddings.py | New on-commit tests for embeddings endpoint. |
| tests/functional/pylintrc | Reworks ignore-paths and disables to enable pylint in CI. |
| tests/functional/object_model/test_helpers.py | Small cleanups to loops/conditionals. |
| tests/functional/object_model/test_environment.py | Adds UTF-8 encoding to JSON config IO. |
| tests/functional/object_model/shape.py | Loop simplification in layout assignment. |
| tests/functional/object_model/resource_monitor.py | f-string conversions; UTF-8 output file writes. |
| tests/functional/object_model/python_custom_nodes/python_custom_nodes.py | Adds pylint suppression. |
| tests/functional/object_model/package_manager.py | Control-flow simplification; logging tweaks; unused var cleanup. |
| tests/functional/object_model/ovsa.py | Unused context manager var cleanup. |
| tests/functional/object_model/ovms_params.py | Modernizes class declaration; control-flow simplification. |
| tests/functional/object_model/ovms_mapping_config.py | Adds UTF-8 encoding; f-string conversions; modernizes class declaration. |
| tests/functional/object_model/ovms_log_monitor.py | Fixes mutable default args; list conversions; small loop cleanups. |
| tests/functional/object_model/ovms_instance.py | Adds pylint suppression; generator-friendly any/all; control-flow cleanup. |
| tests/functional/object_model/ovms_info.py | Import ordering; logging formatting. |
| tests/functional/object_model/ovms_docker.py | Modernizes class declaration; fixes mapping deletion call signature; UTF-8 read_text; dict init cleanup. |
| tests/functional/object_model/ovms_config.py | Fixes mutable default args; adds UTF-8 IO; comprehension cleanups. |
| tests/functional/object_model/ovms_command.py | Refactors command creation control flow; modernizes class declaration. |
| tests/functional/object_model/ovms_capi.py | UTF-8 IO; small command-string cleanups (but currently has duplicate method definition). |
| tests/functional/object_model/ovms_binary.py | Import ordering; generator-friendly any(); UTF-8 read_text. |
| tests/functional/object_model/mediapipe_calculators.py | Uses shared copy_dir_tree; UTF-8 IO; loop/formatting cleanups. |
| tests/functional/object_model/inference_helpers.py | Removes dead KFS path; modernizes class declarations; minor formatting cleanups. |
| tests/functional/object_model/dmesg_log_monitor.py | Minor loop cleanup. |
| tests/functional/object_model/custom_loader.py | UTF-8 write_text; minor dict init cleanup; pylint annotations. |
| tests/functional/models/models.py | Switches model copying to shared copy_dir_tree helper. |
| tests/functional/models/models_library.py | Expands model library for on-commit LLM/VLM and rerank scenarios. |
| tests/functional/models/models_generative.py | Adds VLM model type + rerank models + additional LLMs. |
| tests/functional/models/models_datasets.py | Adds VLM dataset support (base64 image in chat payload) and OVMS-C image path usage. |
| tests/functional/fixtures/server.py | Minor cleanup + f-string conversion. |
| tests/functional/fixtures/ovms.py | Generator-friendly any(); minor cleanup. |
| tests/functional/fixtures/api_type.py | Simplifies returns; fixture id formatting tweaks. |
| tests/functional/data/python_custom_nodes/ovms_corrupted/python_model_writing_to_loopback_output_in_execute.py | Simplifies dict creation for method map. |
| tests/functional/data/python_custom_nodes/ovms_corrupted/python_model_loopback_return_instead_of_yield.py | Simplifies dict creation for method map. |
| tests/functional/data/python_custom_nodes/ovms_corrupted/python_model_loopback_multiple_use_of_valid_outputs.py | Simplifies dict creation for method map. |
| tests/functional/data/python_custom_nodes/ovms_basic/python_model.py | Simplifies dict creation for method map; whitespace cleanup. |
| tests/functional/data/python_custom_nodes/ovms_basic/python_model_loopback.py | Simplifies dict creation for method map; whitespace cleanup. |
| tests/functional/data/ovms_capi_wrapper/setup.py | Formatting cleanup; pylint suppression. |
| tests/functional/data/ovms_capi_wrapper/ovms_autopxd.py | UTF-8 IO; minor control-flow cleanup. |
| tests/functional/constants/pipelines.py | Removes nested conditionals; super() simplification; minor loop cleanup. |
| tests/functional/constants/paths.py | Adds OVMS-C image directory constant; generator-friendly any(). |
| tests/functional/constants/ovms.py | Adds ENDPOINT param name; small control-flow cleanup; pylint suppression. |
| tests/functional/constants/ovms_openai.py | Control-flow simplification; pylint suppression. |
| tests/functional/constants/ovms_messages.py | Adds new error constant(s) (but currently includes a typo in a constant name). |
| tests/functional/constants/ovms_images.py | Refactors OVMS image-name/tag resolution to use new config variables. |
| tests/functional/constants/metrics.py | Minor list conversions and formatting cleanup. |
| tests/functional/conftest.py | Enables pytest plugin wiring when configured (removes hard stop). |
| tests/functional/config.py | Refactors/updates env var handling for images, tags, and on-commit/regression toggles. |
| Makefile | Exports OVMS_CPP_* variables when running functional tests. |
| docs/developer_guide.md | Updates functional-test configuration docs and debugging example. |
| ci/functional_tests_pytest.groovy | New Jenkins pipeline to run pytest functional tests with parameters. |
| ci/build_test_OnCommit.groovy | Detects functional-test changes; adds pylint stage; small doc-test tweak; Windows requirements update. |
Review details
- Files reviewed: 86/86 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+74
to
+99
| def envAssignments = params.TEST_PARAMETERS | ||
| .readLines() | ||
| .findAll { line -> !line.trim().isEmpty() } | ||
| .collect { line -> line.trim() } | ||
| .join(' ') | ||
| def buildDir = "${env.WORKSPACE}/job-${env.BUILD_NUMBER}" | ||
| ws(buildDir) { | ||
| checkout([$class: 'GitSCM', branches: [[name: "*/${params.CORE_BRANCH}"]], userRemoteConfigs: [[url: scm.userRemoteConfigs[0].url, credentialsId: scm.userRemoteConfigs[0].credentialsId]]]) | ||
| sh """ | ||
| set -eux | ||
| test -d .venv || python3 -m venv .venv | ||
| . .venv/bin/activate | ||
| python -m pip install --upgrade pip | ||
| python -m pip install -r tests/requirements.txt | ||
| export TT_XDIST_WORKERS='${params.TT_XDIST_WORKERS}' | ||
| export TT_TARGET_DEVICE='${params.TT_TARGET_DEVICE}' | ||
| export TT_OVMS_IMAGE_NAME='${params.TT_OVMS_IMAGE_NAME}' | ||
| export TT_OVMS_IMAGE_LOCAL='${params.TT_OVMS_IMAGE_LOCAL}' | ||
| export TT_LOGGING_LEVEL_OVMS='${params.TT_LOGGING_LEVEL_OVMS}' | ||
| export TT_ON_COMMIT_TESTS='${params.TT_ON_COMMIT_TESTS}' | ||
| export TT_RUN_REGRESSION_TESTS='${params.TT_RUN_REGRESSION_TESTS}' | ||
| ${envAssignments} pytest ${params.PYTEST_PARAMS} -n ${params.TT_XDIST_WORKERS} --junitxml=pytest-functional.xml | ||
| """ | ||
| junit allowEmptyResults: true, testResults: 'pytest-functional.xml' | ||
| archiveArtifacts allowEmptyArchive: true, artifacts: 'pytest-functional.xml,test_log/**,tests/functional/test_log_build/**' | ||
| } |
Comment on lines
+225
to
+226
| ERROR_LOADING_MODEL_NO_VALID_MODEL = "Error loading model: no valid model file found for model" | ||
| RROR_LOADING_MODEL = "Error occurred while loading model: {}" |
Comment on lines
+179
to
+183
| | `OVMS_CPP_DOCKER_IMAGE` | Docker image name for the tests. | | ||
| | `OVMS_CPP_IMAGE_TAG` | Docker image tag for the tests. | | ||
| | `TT_LOGGING_LEVEL` | The log level for tests. | | ||
| | `TT_LOGGING_LEVEL_OVMS` | The log level for OVMS. | | ||
| | `BUILD_LOGS` | Path to save artifacts. | |
Comment on lines
196
to
200
| def send_terminate_command(self): | ||
| cmd = f"self.running = False" | ||
| cmd = "self.running = False" | ||
| return self.send_command_to_process(cmd) | ||
|
|
||
| def send_terminate_command(self): |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🛠 Summary
Enable on-commit tests part III
🧪 Checklist
``