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
2 changes: 1 addition & 1 deletion .github/workflows/component_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Run Python tests with pytest
run: |
source .venv/bin/activate
python -m pytest --traces=all
python -m pytest --traces=all --log-cli-level=DEBUG

- name: Run Python tests with bazel
run: |
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ pythonpath = [
"tests/test_cases/tests",
]
testpaths = ["tests/test_cases/tests"]
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s %(levelname)s %(message)s"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
markers = [
"root_required", # root permissions are required for this test
"do_not_repeat", # do not repeat this test when using pytest-repeat
Expand Down
2 changes: 2 additions & 0 deletions tests/test_cases/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ score_py_pytest(
"-m cpp",
"--cpp-target-path=$(rootpath //tests/test_scenarios/cpp:test_scenarios)",
"--traces=all",
"--log-cli-level=DEBUG",
],
data = [
":python_tc_venv",
Expand All @@ -64,6 +65,7 @@ score_py_pytest(
"-m rust",
"--rust-target-path=$(rootpath //tests/test_scenarios/rust:test_scenarios)",
"--traces=all",
"--log-cli-level=DEBUG",
],
data = [
":python_tc_venv",
Expand Down
5 changes: 5 additions & 0 deletions tests/test_cases/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ testpaths = tests
pythonpath =
.
tests
log_cli = true
log_cli_level = INFO
log_cli_format = %(asctime)s %(levelname)s %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S

markers =
cpp
rust
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cases/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
psutil
pytest-metadata
pytest-env
testing-utils @ git+https://github.com/eclipse-score/testing_tools.git@675395d4088c8eba708e21d9e5c4efbc75f6a6b0
testing-utils @ git+https://github.com/eclipse-score/testing_tools.git@479f0fdc8e28688df0fb8db80de25592c8386a93
2 changes: 1 addition & 1 deletion tests/test_cases/requirements.txt.lock
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,5 @@ pytest-repeat==0.9.4 \
# via testing-utils
# WARNING: pip install will require the following package to be hashed.
# Consider using a hashable URL like https://github.com/jazzband/pip-tools/archive/SOMECOMMIT.zip
testing-utils @ git+https://github.com/eclipse-score/testing_tools.git@v0.3.0
testing-utils @ git+https://github.com/eclipse-score/testing_tools.git@479f0fdc8e28688df0fb8db80de25592c8386a93
# via -r tests/test_cases/requirements.txt
5 changes: 5 additions & 0 deletions tests/test_cases/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
import logging
import shutil
from pathlib import Path
from typing import Generator

import pytest
from testing_utils import BazelTools, BuildTools, LogContainer, Scenario

logger = logging.getLogger(__name__)


class ResultCode:
"""
Expand Down Expand Up @@ -52,8 +55,10 @@ def temp_dir_common(
parts = [base_name, *args]
dir_name = "-".join(parts)
dir_path = tmp_path_factory.mktemp(dir_name, numbered=True)
logger.info("Created temporary directory: %s", dir_path)
yield dir_path
shutil.rmtree(dir_path)
logger.info("Removed temporary directory: %s", dir_path)


class CommonScenario(Scenario):
Expand Down
6 changes: 4 additions & 2 deletions tests/test_cases/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
import json
import logging
import os
from pathlib import Path

import pytest
from testing_utils import BazelTools

logger = logging.getLogger(__name__)
FAILED_CONFIGS = []


Expand Down Expand Up @@ -81,13 +83,13 @@ def pytest_sessionstart(session):
build_timeout = session.config.getoption("--build-scenarios-timeout")

# Build Rust test scenarios.
print("Building Rust test scenarios executable...")
logger.info("Building Rust test scenarios executable...")
cargo_tools = BazelTools(option_prefix="rust", build_timeout=build_timeout)
rust_target_name = session.config.getoption("--rust-target-name")
cargo_tools.build(rust_target_name)

# Build C++ test scenarios.
print("Building C++ test scenarios executable...")
logger.info("Building C++ test scenarios executable...")
bazel_tools = BazelTools(option_prefix="cpp", build_timeout=build_timeout)
cpp_target_name = session.config.getoption("--cpp-target-name")
bazel_tools.build(cpp_target_name, "--config=per-x86_64-linux")
Expand Down
Loading