We need it in terms of debugging failed tests on CI (create a screenshot for ex.). Right now artifacts tab in CIrcle is not visible if the build failed (because of some test)
We configured manually in each test using Selenium directly using after method:
version: 2
jobs:
build:
resource_class: large
working_directory: ~/bevager/fnb
parallelism: 1
shell: /bin/bash -eo pipefail
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
# In CircleCI 1.0 we used a pre-configured image with a large number of languages and other packages.
# In CircleCI 2.0 you can now specify your own image, or use one of our pre-configured images.
# The following configuration line tells CircleCI to use the specified docker image as the runtime environment for you job.
# We have selected a pre-built image that mirrors the build environment we use on
# the 1.0 platform, but we recommend you choose an image more tailored to the needs
# of each job. For more information on choosing an image (or alternatively using a
# VM instead of a container) see https://circleci.com/docs/2.0/executor-types/
# To see the list of pre-built images that CircleCI provides for most common languages see
# https://circleci.com/docs/2.0/circleci-images/
docker:
- image: circleci/openjdk:8-jdk-node-browsers
- image: mysql:5.7.21
environment:
- MYSQL_ROOT_PASSWORD=ubuntu
- MYSQL_DATABASE=circle_test
steps:
- checkout
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
- run: git clone -b $CIRCLE_BRANCH git@github.com:bevager/fnb-tests.git
- restore_cache:
keys:
# This branch if available
- v4-dep-{{ .Branch }}-
# Default branch if not
- v4-dep-master-
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
- v4-dep-
- run: sudo apt-get install libxss1 libappindicator1 libindicator7 libappindicator3-1
- run: wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- run: sudo dpkg -i ./google-chrome*.deb
- run: sudo apt-get install -f
- run: curl https://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip| gzip -dc > chromedriver
- run: chmod +x chromedriver
- run: sudo npm install -g ember-cli
- run: cd frontend && rm -rf tmp/
- run: cd frontend && npm install
- run: cd backend && ./build no-zip
- run: sudo apt install mysql-client
- run: mysql -h 127.0.0.1 -u root -pubuntu circle_test < test-db.sql
- run:
command: backend/fnbtech-LATEST-BUILD/stage/opt/docker/bin/backend -Dconfig.resource=prod.conf
background: true
- save_cache:
key: v4-dep-{{ .Branch }}-{{ epoch }}
paths:
- vendor/bundle
- ~/virtualenvs
- ~/.m2
- ~/.ivy2
- ~/.bundle
- ~/.gradle
- ~/.cache/bower
- ~/.sbt
- ~/.ivy2
- frontend/node_modules
- backend/target/resolution-cache
- backend/target/streams
- backend/project/target/resolution-cache
- backend/project/target/streams
- run: if (git log --format=%B -n 1 $CIRCLE_SHA1) | grep -iqF release; then cd fnb-tests/FNB-Automation/FNB_Testing && 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 fnb-tests/FNB-Automation/FNB_Testing && mvn clean && mvn test -e -X -Dwebdriver.chrome.driver=../../../chromedriver -Dsurefire.suiteXmlFiles=debug.xml; else cd fnb-tests/FNB-Automation/FNB_Testing && mvn clean && mvn test -e -X -Dwebdriver.chrome.driver=../../../chromedriver -Dsurefire.suiteXmlFiles=smoke.xml; fi
- run: mkdir -p $CIRCLE_TEST_REPORTS/junit/
- run: find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
- store_test_results:
path: /tmp/circleci-test-results
- store_artifacts:
path: /tmp/circleci-artifacts
- store_artifacts:
path: target/universal
- store_artifacts:
path: /tmp/circleci-test-results
Maven file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.FNB</groupId>
<artifactId>FNB_Testing</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>FNB_Testing</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
<scope>test</scope>
</dependency>
<!-- <dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.2</version>
</dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<forkCount>0</forkCount>
<argLine>-Xms1024m -Xmx2048m</argLine>
<suiteXmlFiles>
<suiteXmlFile>regression.xml</suiteXmlFile>
<suiteXmlFile>smoke.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</project>