* Calculate number of managed nodes with this formula:
(( number_of_test_playbooks / 10 + 1 ))
* Add README explaining how to run the plan locally and remotely
Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
3.3 KiB
Introduction CI Testing Plans
Linux System Roles CI runs tmt test plans in Testing farm with the tft.yml GitHub workflow.
The plans/test_playbooks_parallel.fmf plan is a test plan that runs test playbooks in parallel on multiple managed nodes.
plans/test_playbooks_parallel.fmf is generated centrally from https://github.com/linux-system-roles/.github/.
The automation calculates the number of managed nodes to provision with this formula:
number-of-test-playbooks / 10 + 1
The plans/test_playbooks_parallel.fmf plan does the following steps:
- Provisions systems to be used as a control node and as managed nodes.
- Does the required preparation on systems.
- For the given role and the given PR, runs the general test from test.sh.
The tft.yml workflow runs the above plan and uploads the results to our Fedora storage for public access. This workflow uses Testing Farm's Github Action Schedule tests on Testing Farm.
Running Tests
You can run tests locally with the tmt try cli or remotely in Testing Farm.
Running Tests Locally
- Install
tmtas described in Installation. - Change to the role repository directory.
- Modify
plans/test_playbooks_parallel.fmfto suit your requirements:- Due to issue #3138, comment out all managed nodes except for one.
- Optionally modify environment variables to, e.g. run only specified test playbooks by modifying
SYSTEM_ROLES_ONLY_TESTS.
- Enter
tmt try -p plans/test_playbooks_parallel <platform>. This command identifies theplans/test_playbooks_parallel.fmfplan and provisions local VMs, a control node and a managed node. tmt tryis in development and does not identify tests from URL automatically, so after provisioning the machines, you must typet,p,tfrom the interactive prompt to identify tests, run preparation steps, and run the tests.
Running in Testing Farm
-
Install
testing-farmas described in Installation. -
Change to the role repository directory.
-
If you want to run tests with edits in your branch, you need to commit and push changes first to some branch.
-
You can uncomment "Inject your ssh public key to test systems" discover step in the plan if you want to troubleshoot tests by SSHing into test systems in Testing Farm.
-
Enter
testing-farm request. Edit to your needs.$ TESTING_FARM_API_TOKEN=<your_api_token> \ testing-farm request --pipeline-type="tmt-multihost" \ --plan-filter="tag:playbooks_parallel" \ --git-url "https://github.com/<my_user>/network" \ --git-ref "<my_branch>" \ --compose CentOS-Stream-9 \ -e "SYSTEM_ROLES_ONLY_TESTS=tests_default.yml" \ --no-wait