I have two different project repositories: my application repository, and an API repository. My application communicates with the API.
I want to set up some integration and E2E tests of my application. The application will need to use the latest version of the API project when running these tests.
The API project is already setup to deploy when triggered
deploy_integration_tests:
stage: deploy
script:
- echo "deploying..."
environment:
name: integration_testing
only:
- triggers
My application has an integration testing job set up like this:
integration_test
stage: integration_test
script:
- echo "Building and deploying API..."
- curl.exe -X POST -F token=<token> -F ref=develop <url_for_api_trigger>
- echo "Now running the integration test that depends on the API deployment..."
The problem I am having is that the trigger only queues the API pipeline (both projects are using the same runner) and continues before the API pipeline has actually run.
Is there a way to wait for the API pipeline to run before trying to run the integration test?
I can do something like this:
integration_test_dependency
stage: integration_test_dependency
script:
- echo "Building and deploying API..."
- curl.exe -X POST -F token=<token> -F ref=develop <url_for_api_trigger>
integration_test
stage: integration_test
script:
- echo "Now running the integration test that depends on the API deployment..."
But that still doesn't grantee that the API pipeline runs and finishes before moving on to the integration_test stage.
Is there a way to do this?