diff --git a/poetry.lock b/poetry.lock index 64039295..4bd81499 100644 --- a/poetry.lock +++ b/poetry.lock @@ -770,4 +770,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "5a41028a2c142304569a38871947299dbbc88620051201dd804792da22638fa9" +content-hash = "f7c434545c054dc9a2abdaaf8eb0b8a38b0ece4c7076af496739bc00d1d1fe22" diff --git a/pyproject.toml b/pyproject.toml index 2806276c..f51ceabb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,7 @@ pytest-cov = "^6.0.0" pytest-html = "^4.1.1" allure-pytest = "^2.13.5" csv-diff = "^1.2" +coverage = "^7.6.8" [tool.poetry.group.dev.dependencies] pylint = "^3.3.1" @@ -63,3 +64,11 @@ licenseheaders = "^0.8.8" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + +[tool.pytest.ini_options] +markers = [ + "slow: marks tests as slow (deselect with '-m \"not slow\"')", + "serial", + "wip: mark tests as work-in-progress (delect with '-m \"not wip\"')", +] + diff --git a/run_tests.sh b/run_tests.sh index 902bfbdc..9a2ab2a5 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -25,27 +25,35 @@ DIR=$(dirname -- $(realpath ${BASH_SOURCE})) -export PYTHONPATH=$DIR/:$DIR/build/python:${PYTHONPATH} +## export PYTHONPATH=$DIR/:$DIR/build/python:${PYTHONPATH} -mkdir -p $DIR/build +mkdir -p "$DIR"/build -ALLURE_RESULTS_PATH=$DIR/build/allure-results -ALLURE_REPORT_PATH=$DIR/build/allure-report -COVERAGE_PATH=$DIR/build/coverage-results +ALLURE_RESULTS_PATH="$DIR/build/allure-results" +ALLURE_REPORT_PATH="$DIR/build/allure-report" +COVERAGE_PATH="$DIR/build/coverage-results" -poetry run pytest \ - --alluredir $ALLURE_RESULTS_PATH \ - --color no \ - --cov=$COVERAGE_PATH \ - --cov-report=html +set -x +set -e + +rm -rf "$ALLURE_RESULTS_PATH" +rm -rf "$ALLURE_REPORT_PATH" +rm -rf "$COVERAGE_PATH" + +poetry run coverage run -m pytest -m "not slow" \ + --alluredir "$ALLURE_RESULTS_PATH" \ + --color no + +poetry run coverage html --directory "$COVERAGE_PATH" allure generate \ - --single-file $ALLURE_RESULTS_PATH \ - --output $ALLURE_REPORT_PATH \ + --single-file "$ALLURE_RESULTS_PATH" \ + --output "$ALLURE_REPORT_PATH" \ --clean if [[ -z "$RUNNER_OS" ]] && [[ -d "/Applications/Safari.app" ]] then - open -a Safari $ALLURE_REPORT_PATH/index.html + open -a Safari "$ALLURE_REPORT_PATH"/index.html + open -a Safari "$COVERAGE_PATH"/index.html fi diff --git a/tests/rcx25/rcx25_test.py b/tests/rcx25/rcx25_test.py index aba703b7..bf7a0f52 100644 --- a/tests/rcx25/rcx25_test.py +++ b/tests/rcx25/rcx25_test.py @@ -30,8 +30,8 @@ import allure import csv_diff import os +import pytest from typing import * -import unittest import klayout.db as kdb import klayout.lay as klay @@ -129,6 +129,7 @@ def assert_expected_matches_obtained(*path_components, @allure.parent_suite(parent_suite) @allure.tag(*tags) +@pytest.mark.slow def test_single_plate_100um_x_100um_li1_over_substrate(): # MAGIC GIVES (8.3 revision 485): #_______________________________ NOTE: with halo=8µm __________________________________ @@ -142,6 +143,8 @@ def test_single_plate_100um_x_100um_li1_over_substrate(): @allure.parent_suite(parent_suite) @allure.tag(*tags) +@pytest.mark.slow +@pytest.mark.wip def test_overlap_plates_100um_x_100um_li1_m1(): # MAGIC GIVES (8.3 revision 485): #_______________________________ NOTE: with halo=8µm __________________________________ @@ -164,6 +167,8 @@ def test_overlap_plates_100um_x_100um_li1_m1(): @allure.parent_suite(parent_suite) @allure.tag(*tags) +@pytest.mark.slow +@pytest.mark.wip def test_overlap_plates_100um_x_100um_li1_m1_m2_m3(): # MAGIC GIVES (8.3 revision 485): (sorting changed to match order) #_______________________________ NOTE: with halo=8µm __________________________________ @@ -203,6 +208,8 @@ def test_overlap_plates_100um_x_100um_li1_m1_m2_m3(): @allure.parent_suite(parent_suite) @allure.tag(*tags) +@pytest.mark.slow +@pytest.mark.wip def test_sidewall_100um_x_100um_distance_200nm_li1(): # MAGIC GIVES (8.3 revision 485): (sorting changed to match order) # _______________________________ NOTE: with halo=8µm __________________________________ @@ -227,6 +234,8 @@ def test_sidewall_100um_x_100um_distance_200nm_li1(): @allure.parent_suite(parent_suite) @allure.tag(*tags) +@pytest.mark.slow +@pytest.mark.wip def test_sidewall_net_uturn_l1_redux(): # MAGIC GIVES (8.3 revision 485): (sorting changed to match order) # _______________________________ NOTE: with halo=8µm __________________________________ @@ -247,6 +256,8 @@ def test_sidewall_net_uturn_l1_redux(): @allure.parent_suite(parent_suite) @allure.tag(*tags) +@pytest.mark.slow +@pytest.mark.wip def test_sidewall_cap_vpp_04p4x04p6_l1_redux(): # MAGIC GIVES (8.3 revision 485): (sorting changed to match order) # _______________________________ NOTE: with halo=8µm __________________________________ @@ -267,6 +278,8 @@ def test_sidewall_cap_vpp_04p4x04p6_l1_redux(): @allure.parent_suite(parent_suite) @allure.tag(*tags) +@pytest.mark.slow +@pytest.mark.wip def test_near_body_shield_li1_m1(): # MAGIC GIVES (8.3 revision 485): (sorting changed to match order) #_______________________________ NOTE: with halo=8µm __________________________________ @@ -292,6 +305,8 @@ def test_near_body_shield_li1_m1(): @allure.parent_suite(parent_suite) @allure.tag(*tags) +@pytest.mark.slow +@pytest.mark.wip def test_sideoverlap_simple_plates_li1_m1(): # MAGIC GIVES (8.3 revision 485): (sorting changed to match order) # _______________________________ NOTE: with halo=8µm __________________________________