BB-756 - Improve fault tolerance of cleanup script and run it only after all tests are done
This PR add two main changes to the integration cleanup script:
- Improved fault tolerance by catching untreated exceptions
- Added CircleCI workflows configuration to run cleanup only after all tests are done.
Testing
- Checkout this branch
-
vagrant up && vagrant ssh
on Ocim's devstack - Export environment variables needed for cleanup:
export GANDI_API_KEY=
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export GANDI_ZONE_ID=
export OPENSTACK_USER=
export OPENSTACK_TENANT=
export OPENSTACK_REGION=
export OPENSTACK_AUTH_URL=
export OPENSTACK_PASSWORD=
- Run
PYTHONPATH=$PYTHONPATH:$(pwd) honcho -e .env.integration run python3 cleanup_utils/integration_cleanup.py --dry_run
and check that there were no errors on the output. - (OPTIONAL) Run
make test.integration_cleanup
to run the actual cleanup and check that there were no errors on the output. - Check the latest CI run and see that the workflows are working correctly. Latest commit: Workflow: https://circleci.com/workflow-run/8fa529e2-2703-4293-991e-93f7e09d5fd8 CI Run: https://circleci.com/gh/open-craft/opencraft/4249