diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf760c4ab1eb99e2a94073e2ca188592226c22d8..607cb7e200100ffbe9b5d5c81f44b160238aff98 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -406,9 +406,9 @@ test-chart: artifacts: name: "$CI_PROJECT_NAME-$CI_JOB_ID" paths: - - "charts/build/" + - "build/" reports: - junit: charts/build/report.xml + junit: build/report.xml # push: # stage: push diff --git a/charts/Makefile b/charts/Makefile index 42764a2e8d4a71a5c855a00b865eff7dce37f002..425464286988997625be117b7a93f08712d609a6 100644 --- a/charts/Makefile +++ b/charts/Makefile @@ -141,6 +141,7 @@ test: ## test the application on K8s base64 -d | tar -xzf -; \ kubectl --namespace $(KUBE_NAMESPACE) delete pod $(TEST_RUNNER); \ rm ../post-deployment/tango_values.yaml + echo $$status exit $$status show: diff --git a/post-deployment/Makefile b/post-deployment/Makefile index 55d735c3fbcec6eb4d81e9f356ffd8a197aa1261..46a45957791bd5eedf15800fce1e4f2476beed8c 100644 --- a/post-deployment/Makefile +++ b/post-deployment/Makefile @@ -16,7 +16,7 @@ all: test test: install mkdir -p build && \ find . -name "*.pyc" -type f -delete && \ - PYTHONPATH=/app:/app/testing:/app/testing/post-deployment pytest $(if $(findstring all,$(MARK)),, -m $(MARK)) --disable-pytest-warnings | tee pytest.stdout; \ + PYTHONPATH=/app:/app/testing:/app/testing/post-deployment pytest $(if $(findstring all,$(MARK)),, -m $(MARK)) --disable-pytest-warnings | tee pytest.stdout && \ status=$$?; \ $(foreach artfct,$(TEST_ARTIFACTS),mv -f $(artfct) build/;) \ exit $$status diff --git a/post-deployment/features/device_running.feature b/post-deployment/features/device_running.feature deleted file mode 100644 index 1381367000daa067d1b4a4c27d8c4c8ee33a1d4b..0000000000000000000000000000000000000000 --- a/post-deployment/features/device_running.feature +++ /dev/null @@ -1,13 +0,0 @@ -# check device is running -# @skip -Feature: Device commands - -Scenario: Test device is running - Given a device called sys/tg_test/1 - When I call the command State() - Then the attribute State is RUNNING - -Scenario: Test DevString command - Given a device called sys/tg_test/1 - When I call the command DevString(Hello World!) - Then the attribute State is Hello World! \ No newline at end of file diff --git a/post-deployment/features/tango-commands.feature b/post-deployment/features/tango-commands.feature index b3217666713d4a13f10ce79af79b8c9e67e2bad9..9fcb5cb93f25eae7d571fe1334787c54be1a7cf6 100644 --- a/post-deployment/features/tango-commands.feature +++ b/post-deployment/features/tango-commands.feature @@ -22,8 +22,8 @@ Scenario: Test DevString command Scenario: Test short_spectrum_ro quality Given a device called sys/tg_test/1 - Then the attribute short_spectrum_ro is tango._tango.AttrQuality.ATTR_VALID + Then the attribute short_spectrum_ro is ATTR_VALID Scenario: Test short_spectrum quality Given a device called sys/tg_test/1 - Then the attribute short_spectrum is tango._tango.AttrQuality.ATTR_VALID \ No newline at end of file + Then the attribute short_spectrum is ATTR_VALID \ No newline at end of file diff --git a/post-deployment/tests/test_device_running.py b/post-deployment/tests/test_device_running.py deleted file mode 100644 index 9f927a4fb9d2396dced2b6d50d5eaceb8e8d6437..0000000000000000000000000000000000000000 --- a/post-deployment/tests/test_device_running.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -"""features/device_running.feature feature tests.""" -import tango -from pytest_bdd import given, scenario, then, when, parsers - - -@scenario('device_running.feature', 'Test device is running') -def test_test_device_is_running(): - """Test device is running.""" - - -@given(parsers.parse('a device called {device_name}')) -def device_proxy(run_context, device_name): - """a device called sys/tg_test/1.""" - return tango.DeviceProxy(device_name) - - -@when(parsers.cfparse("I call the command {command_name}({parameter:String?})", extra_types=dict(String=str))) -def call_command(device_proxy, command_name): - """I call the command State().""" - return device_proxy.command_inout(command_name) - - -@then(parsers.parse('the attribute {attribute_name} is {expected_value}')) -def check_attribute(device_proxy, attribute_name, expected_value): - """the attribute State is RUNNING.""" - attr = device_proxy.read_attribute(attribute_name) - assert str(attr.value) == expected_value - diff --git a/post-deployment/tests/test_tango-commands.py b/post-deployment/tests/test_tango-commands.py index 68304c8a2eb72d1be2571061d5e1fa5e7949b22b..80b0657e7d3a005cd1cbe4e2e9388464ea47c4dc 100644 --- a/post-deployment/tests/test_tango-commands.py +++ b/post-deployment/tests/test_tango-commands.py @@ -7,11 +7,6 @@ from tango import Database, DeviceProxy, CmdArgType as ArgType from pytest_bdd import given, scenario, then, when, parsers, scenarios - -# @scenario('tango-cpp.feature', 'Call Command and test attribute') -# def test_call_command_and_test_attribute(): -# """Call Command and test attribute.""" - scenarios('../features/tango-commands.feature') @given(parsers.parse('a device called {device_name}'))