-
Notifications
You must be signed in to change notification settings - Fork 5
Parametrized tests workflow
There you can find information about how is testing going behind automated scripts, what environmental variables are reserved, where to add tests after creating them, how to specify configurations to use in tests.
Described in template files here https://github.com/OSLL/mdbci/tree/integration/spec/parametrized_tests_templates
Tests are described in ruby files like https://github.com/OSLL/mdbci/blob/integration/spec/unit_parametrized_tasks.rb or https://github.com/OSLL/mdbci/blob/integration/spec/integration_parametrized_tasks.rb.
Each test is described like this:
- Unit parametrzied test:
task :task_TEST_NAME do |t| RakeTaskManager.new(t).run_unit_parametrized([DOCKER, PPC]) end
- Integration parametrzied test:
task :task_TEST_NAME do |t| RakeTaskManager.new(t).run_integration_parametrized([DOCKER, PPC]) end
Where TEST_NAME is:
filename: test1_spec.rb
TEST_NAME: test1
Methods run_unit_parametrized and run_integration_parametrized of RakeTaskManager takes one parameter: array of provider names. There can be only 3 providers: DOCKER, LIBVIRT, PPC. Depending on what providers you choose, job will create clone for that provider (from the original machine).
In tests you can use next variables:
- ENV[‘mdbci_param_conf_docker’] – cloned docker config
- ENV[‘mdbci_param_conf_libvirt’] – cloned docker libvirt config
- ENV[‘mdbci_param_conf_ppc’] – cloned ppc config
Also there is variables to use original machines:
- ENV[‘mdbci_param_test_docker’] – original docker config
- ENV[‘mdbci_param_test_libvirt’] – original docker libvirt config
- ENV[‘mdbci_param_test_ppc’] – original ppc config
Every config has 3 nodes:
- node1
- node2
- node3
If something nasty happens, cloned machines must be cleaned. To do that go to server, clone somewhere mdbci repository, cd in it.
Run next command:
./scripts/clean_vms.sh mdbci_param_test_clone
But some docker images could survive clean up, and we need to remove them manually:
for i in $(docker images | grep mdbci_param_test_clone); do docker rmi $i; done