Skip to content

Setting up an automatic import in your CI/CD solution


You can set up the importing of test results to Calliope in your CI/CD solution. There are many combinations of technologies on how to do it. Basically, in all methods it comes down to this:

  • (image) You create an environment
  • (build) You pull your code from a repository
  • (build) You install dependencies
  • (test) You execute unit tests on your code
  • (deploy) You deploy your project
  • (test) You execute automated integration tests and UI tests

During the test stages, after the test has completed, you can add a function, to save the results in a file and push the results to a Calliope API-endpoint.


GitLab with docker

  stage: test
  - mkdir output
  - docker run -e "RAILS_ENV=development" --rm -v $PWD/output:/srv/output --name my_test_container container/reference/to/project bundle exec rspec -f d -f RspecJunitFormatter --out /srv/output/rspec.xml
  - if [ "$CI_COMMIT_REF_SLUG" == "master" ]; then CALLIOPE_PROFILE_ID="123"; fi
  - if [ "$CI_COMMIT_REF_SLUG" == "test" ]; then CALLIOPE_PROFILE_ID="456"; else CALLIOPE_PROFILE_ID="789"; fi
  - curl -X POST
         --header "Content-Type:text/xml"
         --header "x-api-key:<API_KEY>"
         --form "file[]=@output/rspec.xml"

GitLab with Selenium image running on Cucumber

image: ruby:2.4

- selenium/standalone-chrome:3.8.1

- bundle install
- export SELENIUM_ENV=remote

    PROFILE_ID: 248
  - bundle exec cucumber -p test BROWSER=chrome -f json -o latest_result.json -f pretty -c
  when: manual

- curl -X POST -H "x-api-key:<API_KEY>" -H "Content-Type:application/*" --data "@latest_result.json" ""${PROFILE_ID}"/report/import/cucumber?os=Ruby24&platform=Selenium381&build=$REVISION" -k

You have a different example?

We're very interested in updating our docs with more examples, so if you have one, feel free to reach out to us!