Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start/stop integration test server on-demand #65

Merged
merged 29 commits into from
Feb 4, 2022
Merged

Conversation

Andy-Grigg
Copy link
Collaborator

@Andy-Grigg Andy-Grigg commented Jan 18, 2022

Closes #48

This PR enables the following functionality:

  • Start the integration test server
  • Check that the server is healthy before starting integration tests
  • Stop the server when the workflow is finished
  • Stop the server if the workflow is cancelled or if a job fails
  • Don't do anything with the server if we aren't running integration tests (e.g. dependabot)
  • Don't stop the server if it wasn't started by this workflow

The final task isn't possible because the principal doesn't currently have permissions to inspect the status of the VM.

However, I have put the foundations in place to enable this by checking if the conclusion of the start_vm job was anything other than skipped. The idea being that in future we can add a job that checks the status (e.g. get_vm_status), and then have the start_vm job proceed only if the result of the get_vm_status job is something like 'stopped' or 'deallocated'.

@Andy-Grigg Andy-Grigg changed the title Check the server is healthy before testing Start/stop integration test server on-demand Jan 18, 2022
@Andy-Grigg Andy-Grigg added the dependencies Related with project dependencies label Feb 3, 2022
@Andy-Grigg Andy-Grigg removed the dependencies Related with project dependencies label Feb 3, 2022
@Andy-Grigg Andy-Grigg added the dependencies Related with project dependencies label Feb 3, 2022
@Andy-Grigg Andy-Grigg removed the dependencies Related with project dependencies label Feb 3, 2022
@Andy-Grigg Andy-Grigg marked this pull request as ready for review February 3, 2022 21:35
Copy link
Collaborator

@da1910 da1910 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment about logging, otherwise looks good and seems to work just fine!

cicd/check_server.py Show resolved Hide resolved
@Andy-Grigg Andy-Grigg merged commit 8339611 into main Feb 4, 2022
@Andy-Grigg Andy-Grigg deleted the cicd/start-stop-vm branch February 4, 2022 14:13
Andy-Grigg pushed a commit that referenced this pull request Jan 11, 2024
Rename external_id on part to external_identity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start and stop VM automatically in CI/CD workflow
2 participants