This is the config.yml
version: 2.1
parameters:
run_integration_tests:
type: boolean
default: false
environment:
type: string
default: test.com
workflows:
version: 2
integration_tests:
when: << pipeline.parameters.run_integration_tests >>
jobs:
- build
jobs:
build:
docker:
- image: circleci/openjdk:8-jdk-stretch-browsers
environment:
# Customize the JVM maximum heap limit
MAVEN_OPTS: -Xmx3200m
steps:
- checkout
- run: mkdir test-reports
- run:
name: Download Selenium
command: |
curl -O http://selenium-release.storage.googleapis.com/3.5/selenium-server-standalone-3.5.3.jar
- run:
name: Start Selenium
command: |
java -jar selenium-server-standalone-3.5.3.jar -log test-reports/selenium.log
background: true
- run: mvn dependency:go-offline
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}
# run tests!
- run: mvn integration-test -Denv=<< pipeline.parameters.environment >>
- run:
name: Save test results
command: |
mkdir -p ~/testng/results/
find . -type f -regex "./test-output/emailable-report.html" -exec cp {} ~/testng/results/ \;
when: always
- store_test_results:
path: ~/testng/results/
- store_artifacts:
path: ~/testng/results/
- store_artifacts:
path: testng/results/
And the api call is as follows
curl -u ${CIRCLECI_TOKEN}: -X POST --header "Content-Type: application/json" -d '{"parameters": {"run_integration_tests": true , "environment": testwebsite.com} }' https://circleci.com/api/v1.1/project/bb/kavya_n17/com.techcrunch.test/tree/master
When i pass the value << pipeline.parameters.environment >> in mvn integration test , the default value is taken and not what i pass in the curl command