How to setup ATF for CI/CD pipeline

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2021 10:09 PM
We've been trying to work on CI/CD for our ServiceNow development and one key part of it is the Automated Test Framework. But almost on all resources released by ServiceNow about CI/CD pipeline, they all gloss over the ATF test suite part. Seems like on all the sample video they provided, the test suite does not contain any real tests that's why they always "pass".
Recent videos released by ServiceNow for CI/CD pipeline setup:
- Setting up your first CI/CD pipeline with GitHub Actions
- Setting up your first CI/CD pipeline with Azure Pipelines
- Setting up your first CI/CD pipeline with GitLab CI/CD Pipelines
- Setting up your first CI/CD pipeline with Jenkins
We've already tried calling an ATF test suite (with client actions) on our pipeline and all we get is the test suite getting skipped because there's no matching client test runner found. From what we gather there is a docker image referenced in the sample pipeline YML template and that should have been the basis of a docker container that will be running the identified ATF test suite.
Is there any special setup that we need to do to ensure that our ATF test suites are run properly as part of the CI/CD pipeline?
- Labels:
-
Automated Test Framework
- 2,897 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2022 02:22 PM
Yes, the example ATF test suite is only a single log step for the purposes of demonstrating calling the API.
To run an ATF test suite with client tests, you do need a scheduled client test runner running somewhere, be that a laptop, a VM, or using our ATF Headless Browser on Docker.
https://docs.servicenow.com/en-US/bundle/sandiego-application-development/page/administer/auto-test-framework/concept/atf-headless-browser.html
https://github.com/ServiceNow/atf-headless-runner/pkgs/container/atf-headless-runner
The task.sh specific to the GitLab implementation resides in the Docker image that is run when you start the pipeline.
It references this: https://github.com/ServiceNow/sncicd-gitlab-docker/blob/master/task.sh
Your GitLab CI/CD needs to be able to spin up runners. https://docs.gitlab.com/runner/
Those runners then pull the Docker image from https://hub.docker.com/repository/docker/servicenowdevx/sncicd-gitlab-docker