Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/component_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build Rust test scenarios
working-directory: component_integration_tests/rust_test_scenarios
working-directory: tests/test_scenarios/rust
run: cargo build

- name: Set up Python 3
Expand All @@ -52,15 +52,13 @@ jobs:
python-version: '3.12'

- name: Set up Python virtual environment
working-directory: component_integration_tests/python_test_cases
run: |
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r tests/test_cases/requirements.txt

- name: Run Python tests with pytest (PR)
if: github.event_name == 'pull_request' || github.event_name == 'push'
working-directory: component_integration_tests/python_test_cases
run: |
source .venv/bin/activate
python -m pytest --traces=all
Expand All @@ -69,7 +67,6 @@ jobs:
if: github.event_name == 'schedule'
env:
NIGHTLY: TRUE
working-directory: component_integration_tests/python_test_cases
run: |
source .venv/bin/activate
python -m pytest --traces=all --count=20 --repeat-scope=session
6 changes: 3 additions & 3 deletions .github/workflows/component_integration_tests_bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ jobs:

- name: Build Test Scenarios with Bazel
run: |
bazel build //component_integration_tests/rust_test_scenarios:rust_test_scenarios
bazel build //tests/test_scenarios/rust:test_scenarios

- name: Build Test Scenarios with Bazel (PR)
if: github.event_name == 'pull_request' || github.event_name == 'push'
run: |
bazel test //component_integration_tests/python_test_cases:cit
bazel test //tests/test_cases:cit

- name: Build Test Scenarios with Bazel (Nightly)
if: github.event_name == 'schedule'
env:
NIGHTLY: TRUE
run: |
bazel test //component_integration_tests/python_test_cases:cit_repeat --test_timeout=1200
bazel test //tests/test_cases:cit_repeat --test_timeout=1200
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ target/
.*swo

# Pytest reports
component_integration_tests/python_test_cases/*.html
component_integration_tests/python_test_cases/*.xml
tests/test_cases/*.html
tests/test_cases/*.xml

#vscode
.vscode*
Expand Down
3 changes: 1 addition & 2 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ copyright_checker(
name = "copyright",
srcs = [
".github",
"component_integration_tests",
"docs",
"internal_docs",
"patches",
Expand Down Expand Up @@ -101,6 +100,6 @@ test_suite(
name = "cit_tests",
testonly = True,
tests = [
"//component_integration_tests/python_test_cases:cit",
"//tests/test_cases:cit",
],
)
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ default-members = ["src/orchestration", "src/orchestration_macros", "src/xtask"]
members = [
"src/orchestration",
"src/xtask",
"component_integration_tests/rust_test_scenarios",
"tests/test_scenarios/rust",
"src/orchestration/examples/camera_drv_object_det",
"src/orchestration_macros",
]
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_depen
pip.parse(
hub_name = "pip_score_venv_test",
python_version = PYTHON_VERSION,
requirements_lock = "//component_integration_tests/python_test_cases:requirements.txt.lock",
requirements_lock = "//tests/test_cases:requirements.txt.lock",
)

use_repo(python)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Repository for **Orchestration framework**

[![Nightly CIT](../../actions/workflows/component_integration_tests.yml/badge.svg)](../../actions/workflows/component_integration_tests.yml)
[![Nightly CIT (Bazel)](../../actions/workflows/component_integration_tests_bazel.yml/badge.svg)](../../actions/workflows/component_integration_tests_bazel.yml)
[![Nightly CIT](../../actions/workflows/tests.yml/badge.svg)](../../actions/workflows/tests.yml)
[![Nightly CIT (Bazel)](../../actions/workflows/tests_bazel.yml/badge.svg)](../../actions/workflows/tests_bazel.yml)


## Feature status and roadmap
Expand Down
Empty file.
22 changes: 20 additions & 2 deletions .ruff.toml → pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
[tool.pytest]
addopts = ["-v"]
pythonpath = [
"tests/test_cases",
"tests/test_cases/tests",
]
testpaths = ["tests/test_cases/tests"]
markers = [
"root_required", # root permissions are required for this test
"do_not_repeat", # do not repeat this test when using pytest-repeat
"only_nightly", # run this test only in nightly runs
]
junit_log_passing_tests = true

[tool.pytest_env]
RUST_BACKTRACE = {value = "1", skip_if_set = true}

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
Expand Down Expand Up @@ -26,7 +44,7 @@ exclude = [
line-length = 120
indent-width = 4

[lint]
[tool.ruff.lint]
select = [
# flake8-boolean-trap
"FBT",
Expand Down Expand Up @@ -83,7 +101,7 @@ unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[format]
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

Expand Down
6 changes: 3 additions & 3 deletions scripts/run_component_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

# For the documentation, please refer to component_integration_tests/python_test_cases/run_tests.py
# For the documentation, please refer to tests/test_cases/run_tests.py
#
# Example usage:
# Run all tests:
# ./run_component_tests.sh
#
# Run all tests in a specific file (file path must be relative to python_test_cases folder):
# Run all tests in a specific file (file path must be relative to test_cases folder):
# ./run_component_tests.sh tests/runtime/worker/test_worker_basic.py
#
# Run a specific scenario:
Expand All @@ -27,5 +27,5 @@
FILE_PATH=$(realpath "$0")
FILE_DIR=$(dirname "$FILE_PATH")

cd "$FILE_DIR"/../component_integration_tests/python_test_cases || exit 1
cd "$FILE_DIR"/../tests/test_cases || exit 1
./run_tests.py "$@"
6 changes: 3 additions & 3 deletions src/xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn main() {
"build:scenarios" => {
run_build(
"debug_build",
&["build", "--manifest-path", "component_integration_tests/rust_test_scenarios/Cargo.toml"],
&["build", "--manifest-path", "tests/test_scenarios/rust/Cargo.toml"],
envs,
cli_env_vars,
&passthrough_args,
Expand All @@ -110,9 +110,9 @@ fn main() {
&[
"run",
"--manifest-path",
"component_integration_tests/rust_test_scenarios/Cargo.toml",
"tests/test_scenarios/rust/Cargo.toml",
"--bin",
"rust_test_scenarios",
"test_scenarios",
],
envs,
cli_env_vars,
Expand Down
18 changes: 0 additions & 18 deletions tests/BUILD

This file was deleted.

16 changes: 8 additions & 8 deletions component_integration_tests/README.md → tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ Create `venv`, activate and install dependencies:
```bash
python -m venv <REPO_ROOT>/.venv
source <REPO_ROOT>/.venv/bin/activate
pip install -r <REPO_ROOT>/component_integration_tests/python_test_cases/requirements.txt
pip install -r <REPO_ROOT>/tests/test_cases/requirements.txt
```

## Usage

Set current working directory to the following:

```bash
cd <REPO_ROOT>/component_integration_tests/python_test_cases
cd <REPO_ROOT>/tests/test_cases
```

### Run tests

Bazel:

```bash
bazel test //component_integration_tests/python_test_cases:cit
bazel test //tests/test_cases:cit
```

Basic run:
Expand Down Expand Up @@ -80,7 +80,7 @@ Test scenarios can be run independently from `pytest`.
Set current working directory to the following:

```bash
cd <REPO_ROOT>/component_integration_tests/rust_test_scenarios
cd <REPO_ROOT>/tests/test_scenarios/rust
```

List all available scenarios:
Expand All @@ -104,7 +104,7 @@ cargo run -- --name basic.only_shutdown --input '{"runtime": {"task_queue_size":
Run test scenario executable directly:

```bash
<REPO_ROOT>/target/debug/rust_test_scenarios --name basic.only_shutdown --input '{"runtime": {"task_queue_size": 256, "workers": 1}}'
<REPO_ROOT>/target/debug/test_scenarios --name basic.only_shutdown --input '{"runtime": {"task_queue_size": 256, "workers": 1}}'
```

### Using Bazel
Expand All @@ -113,17 +113,17 @@ Bazel handles all setup steps like environment, rebuilding test scenarios by its
All Component Integration Tests can be executed with:

```bash
bazel test //component_integration_tests/python_test_cases:cit
bazel test //tests/test_cases:cit
```

Run all tests 5 times to check for sporadic errors:

```bash
bazel test //component_integration_tests/python_test_cases:cit_repeat
bazel test //tests/test_cases:cit_repeat
```

Run Test Scenarios:

```bash
bazel run //component_integration_tests/rust_test_scenarios:rust_test_scenarios -- --help
bazel run //tests/test_scenarios/rust:test_scenarios -- --help
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ load("@rules_python//python:pip.bzl", "compile_pip_requirements")
load("@score_tooling//python_basics:defs.bzl", "score_py_pytest", "score_virtualenv")

# In order to update the requirements, change the `requirements.in` file and run:
# `bazel run //component_integration_tests/python_test_cases:requirements.update`.
# `bazel run //tests/test_cases:requirements.update`.
# This will update the `requirements.txt` file.
# To upgrade all dependencies to their latest versions, run:
# `bazel run //component_integration_tests/python_test_cases:requirements.update -- --upgrade`.
# `bazel run //tests/test_cases:requirements.update -- --upgrade`.
compile_pip_requirements(
name = "requirements",
srcs = [
Expand All @@ -43,11 +43,11 @@ score_py_pytest(
srcs = glob(["tests/**/*.py"]),
args = [
"--traces=all",
"--target-path=$(rootpath //component_integration_tests/rust_test_scenarios)",
"--target-path=$(rootpath //tests/test_scenarios/rust:test_scenarios)",
],
data = [
":python_tc_venv",
"//component_integration_tests/rust_test_scenarios",
"//tests/test_scenarios/rust:test_scenarios",
],
env = {
"RUST_BACKTRACE": "1",
Expand All @@ -66,11 +66,11 @@ score_py_pytest(
"--traces=all",
"--count=5",
"--repeat-scope=session",
"--target-path=$(rootpath //component_integration_tests/rust_test_scenarios)",
"--target-path=$(rootpath //tests/test_scenarios/rust:test_scenarios)",
],
data = [
":python_tc_venv",
"//component_integration_tests/rust_test_scenarios",
"//tests/test_scenarios/rust:test_scenarios",
],
env = {
"RUST_BACKTRACE": "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
# *******************************************************************************
[pytest]
addopts = -v
testpaths = tests
pythonpath = ../..
testpaths = tests/test_cases/tests
pythonpath =
tests

; Additional environment variables
env = D:RUST_BACKTRACE = 1
Expand All @@ -22,3 +23,7 @@ markers =
root_required: root permissions are required for this test.
do_not_repeat: do not repeat this test when using pytest-repeat.
only_nightly: run this test only in nightly runs.

filterwarnings =
ignore::pytest.PytestWarning
ignore::pytest.PytestExperimentalApiWarning
Loading
Loading