Open sysarch-repo opened 2 months ago
Thank you @sysarch-repo for your feedbacks.
I'm not clear about your benefits here. By calling with "all", xtesting basically schedules all the tests one by one sequentially. If you list them all in the yaml files, Jenkins or GitLab CI/CD is rather in charge of the schedulling which allows you more flexibility especially to run them in parallel.
If I understand correctly, your request would be not to create 1 job per testcase but a single 'all' job ; the test case publications (DB and S3) would remain unchanged. That would result in a bit of extra logic in jenkins job template.
I must also check if it would work with a mutiple container use.
@collivier
thank you for your comments.
I believe the issue is using the same URL
http://10.0.3.15:8181/RTE2QIGHRW2J/hello_world-127_0_0_1-hello-world-tests-latest-all-3/xtesting.log
across the individual tests. This probably creates a race condition resulting in the truncated log file.
I further assume this root cause is found in the xtesting Python library rather than in the CI framework.
Acceptance tests may comprise of hundred test cases and it therefore is more convenient to run them as one Jenkins job. This can be achieved by adding "all" to the test list, i.e.:
The console output in Jenkins is showing the following expected result:
The JSON files accessible via
{"project_name": "hello_world", "scenario": "os-nosdn-nofeature-noha", "stop_date": "2024-08-09 17:46:58", "case_name": "Test2", "build_tag": "RTE2QIGHRW2J", "version": "unknown", "pod_name": "hello_world", "criteria": "PASS", "installer": "unknown", "_id": "66b65612f58ff39d3d7ddb7b", "start_date": "2024-08-09 17:46:58", "details": {"links": ["http://10.0.3.15:8181/RTE2QIGHRW2J/hello_world-127_0_0_1-hello-world-tests-latest-all-3/xtesting.log"]}}
But the published log file accessible via
+-------------------------+-----------------------------------------------------------+ | ENV VAR | VALUE | +-------------------------+-----------------------------------------------------------+ | CI_LOOP | daily | | DEBUG | false | | DEPLOY_SCENARIO | os-nosdn-nofeature-noha | | INSTALLER_TYPE | unknown | | BUILD_TAG | RTE2QIGHRW2J | | NODE_NAME | hello_world | | TEST_DB_URL | http://10.0.3.15:8000/api/v1/results | | TEST_DB_EXT_URL | http://10.0.3.15:8000/api/v1/results | | S3_ENDPOINT_URL | http://10.0.3.15:9000 | | S3_DST_URL | s3://xtesting/RTE2QIGHRW2J/hello_world-127_0_0_1- | | | hello-world-tests-latest-all-3 | | HTTP_DST_URL | http://10.0.3.15:8181/RTE2QIGHRW2J/hello_world- | | | 127_0_0_1-hello-world-tests-latest-all-3 | +-------------------------+-----------------------------------------------------------+
2024-08-09 17:46:58,413 - xtesting.ci.run_tests - INFO - TESTS TO BE EXECUTED:
+---------------------+-------------------------------------------+---------------------+ | TIERS | DESCRIPTION | TESTCASES | +---------------------+-------------------------------------------+---------------------+ | Basic tests | This is hello world basic testing | Test1 Test2 | +---------------------+-------------------------------------------+---------------------+
2024-08-09 17:46:58,429 - xtesting.ci.run_tests - INFO - Loading test case 'Test1'... 2024-08-09 17:46:58,477 - xtesting.ci.run_tests - INFO - Running test case 'Test1'... 2024-08-09 17:46:58,477 - xtesting.ci.run_tests - INFO - Test result:
+-------------------+---------------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +-------------------+---------------------+------------------+----------------+ | Test1 | hello_world | 00:00 | PASS | +-------------------+---------------------+------------------+----------------+
2024-08-09 17:46:58,822 - xtesting.core.testcase - INFO - All artifacts were successfully published:
http://10.0.3.15:8181/RTE2QIGHRW2J/hello_world-127_0_0_1-hello-world-tests-latest-all-3/xtesting.log
2024-08-09 17:46:58,844 - xtesting.core.testcase - INFO - The results were successfully pushed to DB:
http://10.0.3.15:8000/api/v1/results/66b65612f58ff39d3d7ddb7a
2024-08-09 17:46:58,861 - xtesting.ci.run_tests - INFO - Loading test case 'Test2'... 2024-08-09 17:46:58,873 - xtesting.ci.run_tests - INFO - Running test case 'Test2'... 2024-08-09 17:46:58,873 - xtesting.ci.run_tests - INFO - Test result:
+-------------------+---------------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +-------------------+---------------------+------------------+----------------+ | Test2 | hello_world | 00:00 | PASS | +-------------------+---------------------+------------------+----------------+