From 4454b70938c9706c47a93cc9ceb69942af3db321 Mon Sep 17 00:00:00 2001 From: wep23441 <elizabeth.mamtsits@stfc.ac.uk> Date: Thu, 27 Mar 2025 14:38:12 +0100 Subject: [PATCH] testing case 2.3 --- .gitlab-ci.yml | 8 +++---- case-2-test/requirements.txt | 2 +- case-2-test/test_wizard_calculator.py | 30 +++++++++++++-------------- ci-configs/case-2-test/unit_test.yml | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 56df23c..11edaa7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,16 +12,16 @@ include: # # Case 2 Test # # stages: code_quality, test # - local: ci-configs/case-2-test/lint.yml -- local: ci-configs/case-2-test/coverage.yml -- local: ci-configs/case-2-test/unit_test.yml +# - local: ci-configs/case-2-test/coverage.yml +# - local: ci-configs/case-2-test/unit_test.yml # # Case 3 Build # # stages: code_quality, test, build, build_image # - local: ci-configs/case-3-build/lint.yml # - local: ci-configs/case-3-build/coverage.yml # - local: ci-configs/case-3-build/unit_test.yml -# - local: ci-configs/case-3-build/build.yml -# - local: ci-configs/case-3-build/build_image.yml +- local: ci-configs/case-3-build/build.yml +- local: ci-configs/case-3-build/build_image.yml # Case 4 Security # stages: code_quality, security_checks, build_image, test_image diff --git a/case-2-test/requirements.txt b/case-2-test/requirements.txt index c7aedbd..0b0baac 100644 --- a/case-2-test/requirements.txt +++ b/case-2-test/requirements.txt @@ -1,3 +1,3 @@ -pytest==8.3.5 +pytest==999.999.999 pytest-cov==6.0.0 coverage==7.7.0 diff --git a/case-2-test/test_wizard_calculator.py b/case-2-test/test_wizard_calculator.py index a1a9223..5b31771 100644 --- a/case-2-test/test_wizard_calculator.py +++ b/case-2-test/test_wizard_calculator.py @@ -1,4 +1,4 @@ -import pytest +import pytest, math, pytorch, numpy from wizard_calculator import ( summon_dragons, @@ -21,21 +21,21 @@ def test_vanish_trolls(): assert vanish_trolls(10, 0) == 10 -def test_brew_potions(): - assert brew_potions(2, 3) == 6 - assert brew_potions(-1, 3) == -3 - assert brew_potions(0, 100) == 0 +# def test_brew_potions(): +# assert brew_potions(2, 3) == 6 +# assert brew_potions(-1, 3) == -3 +# assert brew_potions(0, 100) == 1 -def test_cast_division_spell(): - assert cast_division_spell(6, 3) == 2 - assert cast_division_spell(10, 2) == 5 - assert cast_division_spell(7, 7) == 1 - with pytest.raises(ValueError): - cast_division_spell(1, 0) +# def test_cast_division_spell(): +# assert cast_division_spell(6, 3) == 2 +# assert cast_division_spell(10, 2) == 3 +# assert cast_division_spell(7, 7) == 1 +# with pytest.raises(ValueError): +# cast_division_spell(1, 0) -def test_conjure_magic_circle_area(): - assert conjure_magic_circle_area(3) == pytest.approx(28.274, 0.001) - assert conjure_magic_circle_area(0) == 0 - assert conjure_magic_circle_area(1) == pytest.approx(3.14159, 0.001) +# def test_conjure_magic_circle_area(): +# assert conjure_magic_circle_area(3) == pytest.approx(28.274, 0.001) +# assert conjure_magic_circle_area(0) == 0 +# assert conjure_magic_circle_area(1) == pytest.approx(3.14159, 0.001) diff --git a/ci-configs/case-2-test/unit_test.yml b/ci-configs/case-2-test/unit_test.yml index b04dae3..4fd2c1b 100644 --- a/ci-configs/case-2-test/unit_test.yml +++ b/ci-configs/case-2-test/unit_test.yml @@ -3,5 +3,5 @@ unit_test: image: python:3.11 script: - pip install -r ./case-2-test/requirements.txt - - pytest ./case-2-test/test_wizard_calculator.py + - pytestt ./case-2-test/test_wizard_calculator.py allow_failure: false -- GitLab