From 2e6ac989a43676530dd27e610766faa2b4c5f989 Mon Sep 17 00:00:00 2001 From: Moraru Razvan Date: Tue, 14 Dec 2021 13:19:36 +0100 Subject: [PATCH 1/7] Test circleci orb. --- .circleci/config.yml | 50 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e95a0dc..e377e42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,8 @@ -version: 2 +--- +version: 2.1 +orbs: + railflow: railflow/railflow-orb@0.0.1 + jobs: build: docker: @@ -35,12 +39,54 @@ jobs: name: Run railflow testing command: npx railflow -k $RAILFLOW_KEY -url https://testrail6.railflow.io/ -u $RAILFLOW_USERNAME -p $RAILFLOW_PASSWORD -pr "Github-Demo" -path Demo/TestNG -f testng -r /usr/railflow/testng-results.xml -tp TestPlanName + railflow_orb_test: + working_directory: ~/repo + executor: railflow/default + shell: /bin/bash --login -o pipefail + environment: + RAILFLOW_KEY: $RAILFLOW_KEY + RAILFLOW_URL: https://testrail6.railflow.io/ + RAILFLOW_USERNAME: $RAILFLOW_USERNAME + RAILFLOW_PASSWORD: $RAILFLOW_PASSWORD + RAILFLOW_PROJECT_NAME: Github-ORB-Demo + RAILFLOW_PROJECT_PATH: Demo/TestNG + RAILFLOW_REPORT_FORMAT: testng + RAILFLOW_REPORT_PATH: /usr/railflow/testng-results.xml + RAILFLOW_SEARCH_MODE: path + RAILFLOW_TEST_PLAN: OrbTestPlanName + RAILFLOW_TEST_RUN: tr_testrun + RAILFLOW_ASSIGN_FAILURE_TO: redcom@gmail.com + steps: + - railflow/test: + RAILFLOW_KEY: $RAILFLOW_KEY + RAILFLOW_URL: $RAILFLOW_URL + RAILFLOW_USERNAME: $RAILFLOW_USERNAME + RAILFLOW_PASSWORD: $RAILFLOW_PASSWORD + RAILFLOW_PROJECT_NAME: $RAILFLOW_PROJECT_NAME + RAILFLOW_PROJECT_PATH: $RAILFLOW_PROJECT_PATH + RAILFLOW_REPORT_FORMAT: $RAILFLOW_REPORT_FORMAT + RAILFLOW_REPORT_PATH: $RAILFLOW_REPORT_PATH + RAILFLOW_SEARCH_MODE: $RAILFLOW_SEARCH_MODE + RAILFLOW_TEST_PLAN: $RAILFLOW_TEST_PLAN + RAILFLOW_TEST_RUN: $RAILFLOW_TEST_RUN + RAILFLOW_ASSIGN_FAILURE_TO: $RAILFLOW_ASSIGN_FAILURE_TO + - run: + name: Run railflow testing + command: | + echo -e "\n$RAILFLOW_KEY\n$RAILFLOW_USERNAME\n$RAILFLOW_PASSWORD" > testsetup && cat testsetup + + - store_artifacts: + path: $RAILFLOW_REPORT_PATH + destination: railflow-artifacts workflows: - version: 2 + version: 2.1 build_and_test: jobs: - build - railflow_test: requires: - build + - railflow_orb_test: + requires: + - build From b3b4cf5caa418f3878f63d0901ffe1ed9f4a5af0 Mon Sep 17 00:00:00 2001 From: Moraru Razvan Date: Tue, 14 Dec 2021 13:26:04 +0100 Subject: [PATCH 2/7] Add circleci branch workflow --- .circleci/config.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e377e42..8c88884 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -89,4 +89,17 @@ workflows: - railflow_orb_test: requires: - build + pull_request: + jobs: + - build: + filters: + branches: + ignore: + - main + - railflow_test: + requires: + - build + - railflow_orb_test: + requires: + - build From 504e9cd29550fcd646ee493432e0ca5741302e7d Mon Sep 17 00:00:00 2001 From: Moraru Razvan Date: Tue, 14 Dec 2021 13:31:12 +0100 Subject: [PATCH 3/7] Build separate workflow for PR and main --- .circleci/config.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c88884..257a868 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -82,13 +82,14 @@ workflows: version: 2.1 build_and_test: jobs: - - build + - build: + filters: + branches: + only: + - development - railflow_test: requires: - build - - railflow_orb_test: - requires: - - build pull_request: jobs: - build: From 8a961788ebfa4189650fbbb17122f6bfec13514f Mon Sep 17 00:00:00 2001 From: Moraru Razvan Date: Tue, 14 Dec 2021 13:38:34 +0100 Subject: [PATCH 4/7] Correct checkout path --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 257a868..8012f3d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,7 +40,7 @@ jobs: command: npx railflow -k $RAILFLOW_KEY -url https://testrail6.railflow.io/ -u $RAILFLOW_USERNAME -p $RAILFLOW_PASSWORD -pr "Github-Demo" -path Demo/TestNG -f testng -r /usr/railflow/testng-results.xml -tp TestPlanName railflow_orb_test: - working_directory: ~/repo + working_directory: /usr/railflow executor: railflow/default shell: /bin/bash --login -o pipefail environment: From 9bf1347dc64080823e6a80cfea1d3f6a16488fec Mon Sep 17 00:00:00 2001 From: Moraru Razvan Date: Tue, 14 Dec 2021 13:45:08 +0100 Subject: [PATCH 5/7] Change path of the checkout project --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8012f3d..d5ca593 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,7 +40,7 @@ jobs: command: npx railflow -k $RAILFLOW_KEY -url https://testrail6.railflow.io/ -u $RAILFLOW_USERNAME -p $RAILFLOW_PASSWORD -pr "Github-Demo" -path Demo/TestNG -f testng -r /usr/railflow/testng-results.xml -tp TestPlanName railflow_orb_test: - working_directory: /usr/railflow + working_directory: /usr/railflow-orb executor: railflow/default shell: /bin/bash --login -o pipefail environment: @@ -51,7 +51,7 @@ jobs: RAILFLOW_PROJECT_NAME: Github-ORB-Demo RAILFLOW_PROJECT_PATH: Demo/TestNG RAILFLOW_REPORT_FORMAT: testng - RAILFLOW_REPORT_PATH: /usr/railflow/testng-results.xml + RAILFLOW_REPORT_PATH: /usr/railflow-orb/testng-results.xml RAILFLOW_SEARCH_MODE: path RAILFLOW_TEST_PLAN: OrbTestPlanName RAILFLOW_TEST_RUN: tr_testrun From 7134d6d70b111b13e9239da5119da76ce6330354 Mon Sep 17 00:00:00 2001 From: Moraru Razvan Date: Tue, 14 Dec 2021 15:12:09 +0100 Subject: [PATCH 6/7] Update version or orb and correct parammeters --- .circleci/config.yml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d5ca593..979d432 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ --- version: 2.1 orbs: - railflow: railflow/railflow-orb@0.0.1 + railflow: railflow/railflow-orb@0.0.4 jobs: build: @@ -23,6 +23,11 @@ jobs: - store_artifacts: path: ./target/surefire-reports/testng-results.xml + - persist_to_workspace: + root: ~/repo + paths: + - ./target + railflow_test: docker: - image: railflow/railflow:2.0.6 @@ -40,25 +45,30 @@ jobs: command: npx railflow -k $RAILFLOW_KEY -url https://testrail6.railflow.io/ -u $RAILFLOW_USERNAME -p $RAILFLOW_PASSWORD -pr "Github-Demo" -path Demo/TestNG -f testng -r /usr/railflow/testng-results.xml -tp TestPlanName railflow_orb_test: - working_directory: /usr/railflow-orb + working_directory: ~/repo executor: railflow/default shell: /bin/bash --login -o pipefail environment: - RAILFLOW_KEY: $RAILFLOW_KEY + # secrets store in circleci environment variables for project + # RAILFLOW_KEY + # RAILFLOW_USERNAME + # RAILFLOW_PASSWORD + RAILFLOW_URL: https://testrail6.railflow.io/ - RAILFLOW_USERNAME: $RAILFLOW_USERNAME - RAILFLOW_PASSWORD: $RAILFLOW_PASSWORD - RAILFLOW_PROJECT_NAME: Github-ORB-Demo + RAILFLOW_PROJECT_NAME: Github-Demo RAILFLOW_PROJECT_PATH: Demo/TestNG RAILFLOW_REPORT_FORMAT: testng - RAILFLOW_REPORT_PATH: /usr/railflow-orb/testng-results.xml + RAILFLOW_REPORT_PATH: ~/repo/target/surefire-reports/testng-results.xml RAILFLOW_SEARCH_MODE: path - RAILFLOW_TEST_PLAN: OrbTestPlanName - RAILFLOW_TEST_RUN: tr_testrun + RAILFLOW_TEST_PLAN: TestPlanName + RAILFLOW_TEST_RUN: "" RAILFLOW_ASSIGN_FAILURE_TO: redcom@gmail.com steps: + - checkout + - attach_workspace: + at: ./ - railflow/test: - RAILFLOW_KEY: $RAILFLOW_KEY + RAILFLOW_KEY: $RAILFLOW_KEY_RAZVAN RAILFLOW_URL: $RAILFLOW_URL RAILFLOW_USERNAME: $RAILFLOW_USERNAME RAILFLOW_PASSWORD: $RAILFLOW_PASSWORD @@ -70,10 +80,6 @@ jobs: RAILFLOW_TEST_PLAN: $RAILFLOW_TEST_PLAN RAILFLOW_TEST_RUN: $RAILFLOW_TEST_RUN RAILFLOW_ASSIGN_FAILURE_TO: $RAILFLOW_ASSIGN_FAILURE_TO - - run: - name: Run railflow testing - command: | - echo -e "\n$RAILFLOW_KEY\n$RAILFLOW_USERNAME\n$RAILFLOW_PASSWORD" > testsetup && cat testsetup - store_artifacts: path: $RAILFLOW_REPORT_PATH From 0fb5503e80fd9b366ccca5992f9a276743a7a6f0 Mon Sep 17 00:00:00 2001 From: Moraru Razvan Date: Tue, 14 Dec 2021 15:15:26 +0100 Subject: [PATCH 7/7] Update version of orb to 0.0.5 --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 979d432..2960a7e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ --- version: 2.1 orbs: - railflow: railflow/railflow-orb@0.0.4 + railflow: railflow/railflow-orb@0.0.5 jobs: build: @@ -61,7 +61,6 @@ jobs: RAILFLOW_REPORT_PATH: ~/repo/target/surefire-reports/testng-results.xml RAILFLOW_SEARCH_MODE: path RAILFLOW_TEST_PLAN: TestPlanName - RAILFLOW_TEST_RUN: "" RAILFLOW_ASSIGN_FAILURE_TO: redcom@gmail.com steps: - checkout @@ -78,7 +77,6 @@ jobs: RAILFLOW_REPORT_PATH: $RAILFLOW_REPORT_PATH RAILFLOW_SEARCH_MODE: $RAILFLOW_SEARCH_MODE RAILFLOW_TEST_PLAN: $RAILFLOW_TEST_PLAN - RAILFLOW_TEST_RUN: $RAILFLOW_TEST_RUN RAILFLOW_ASSIGN_FAILURE_TO: $RAILFLOW_ASSIGN_FAILURE_TO - store_artifacts: