How to make 3-4 commits to launch different type of automated UI tests in CircleCI?

docker
bash

#1

Before it was working for regression and sanity tests:

Inside config.yml file:
- run: if (git log --format=%B -n 1 $CIRCLE_SHA1) | grep -iqF release; then cd <company_folder> && mvn clean && mvn test -e -X -Dwebdriver.chrome.driver=../../../chromedriver -Dsurefire.suiteXmlFiles=regression.xml; else cd <company_folder> && mvn clean && mvn test -e -X -Dwebdriver.chrome.driver=../../../chromedriver -Dsurefire.suiteXmlFiles=smoke.xml; fi

When we added for ‘debug’ commit - all builds started failing. - run: if (git log --format=%B -n 1 $CIRCLE_SHA1) | grep -iqF release; then cd <company_folder> && mvn clean && mvn test -e -X -Dwebdriver.chrome.driver=../../../chromedriver -Dsurefire.suiteXmlFiles=regression.xml; elif (git log --format=%B -n 1 $CIRCLE_SHA1) | grep -iqF debug; then cd <company_folder> && mvn clean && mvn test -e -X -Dwebdriver.chrome.driver=../../../chromedriver -Dsurefire.suiteXmlFiles=debug.xml; else cd <company_folder> && mvn clean && mvn test -e -X -Dwebdriver.chrome.driver=../../../chromedriver -Dsurefire.suiteXmlFiles=smoke.xml; fi

We want to make ‘Debug’ commit for debugging failed tests, because we don’t want to wait 1 hour until all tests will be run.


#2

In what way did they fail?

That is understandable. Are you tests taking an hour to finish, or an hour to start? What is the reason for slowness?


#4
  1. At this point. 0 tests were run:
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project There are test failures.
  2. One hour to finish. It’s a regression suite - application is huge

#5

Ah right, you want to re-run just failed tests - that makes sense now. :+1:


#6

I want to make a new ‘Debug’ commit to debug failed tests from regression and smoke suite


#7

A few ideas:

  • you could inject variables using the Environment Vars screen
  • use a tag name which is treated differently
  • use a branch name which is treated differently

#8

Thank you.
Do you know if the syntax is correct?


#9

I’ve no idea, sorry. You’ll probably find that to be a niche question - you’re unlikely to get someone to just know by looking at it. It really needs someone to set it up and experiment by themselves, and that might be testing the boundaries of what is reasonable to ask of volunteers.

Have you tried searching for your error? It mentions “[t]here are test failures” - does it say what they are?


#11

It shows that debug.xml is not a valid file. But this file is located in same folder with other xml files, regression and sanity:

https://pastecode.xyz/view/42e1a574