From 3ad869011356f29322288969e022c225f51d7e3c Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Sun, 17 Mar 2024 17:25:06 +0500 Subject: [PATCH 1/2] stack behind secrets --- .github/workflows/api_workflow.yml | 2 +- api_run.sh | 3 ++- pytest.ini | 7 ------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/api_workflow.yml b/.github/workflows/api_workflow.yml index b7ac72d7..39f2517c 100644 --- a/.github/workflows/api_workflow.yml +++ b/.github/workflows/api_workflow.yml @@ -115,7 +115,7 @@ jobs: fi source $HOME/.bp-venv/bin/activate - sh api_run.sh "$TAGS" + sh api_run.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "http://localhost:63342/pytest-automation-boilerplate/output/allure/reports/index.html" "${{secrets.TEAMS_WEBHOOK_URL}}" - name: Get Allure history uses: actions/checkout@v4 diff --git a/api_run.sh b/api_run.sh index eba35f0c..07812f93 100755 --- a/api_run.sh +++ b/api_run.sh @@ -1,4 +1,5 @@ #!/bin/sh # Run API tests -python -m pytest -v -s --gherkin-terminal-reporter --html="./output/reports/" --tags=$1 --self-contained-html --reruns 1 --reruns-delay 2 --alluredir=allure-results \ No newline at end of file +python -m pytest -v -s --gherkin-terminal-reporter --html="./output/reports/" --tags=$1 --self-contained-html --reruns 1 --reruns-delay 2 --alluredir=allure-results \ +--slack-webhook-url=$2 --slack-channel=pytest-test-automation --slack-results-url=$3 --teams-webhook-url=$4 --teams-results-url=$3 \ No newline at end of file diff --git a/pytest.ini b/pytest.ini index 07c11cd0..7104920f 100755 --- a/pytest.ini +++ b/pytest.ini @@ -17,10 +17,3 @@ addopts = # Allure Report arguments --clean-alluredir --alluredir=output/allure/results -# Slack Notification arguments (fake hook for testing purpose only - --slack-webhook-url=https://hooks.slack.com/services/.. - --slack-channel=pytest-test-automation - --slack-results-url=http://localhost:63342/pytest-automation-boilerplate/output/allure/reports/index.html -# MS Teams Notification arguments(fake hook for testing purpose only - --teams-webhook-url=https://moduscreate.webhook.office.com/webhookb2/... - --teams-results-url=http://localhost:63342/pytest-automation-boilerplate/output/allure/reports/index.html From dba0894ab1682558dbaeef8351ce12f74d192cfe Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Sun, 17 Mar 2024 17:33:51 +0500 Subject: [PATCH 2/2] stack behind secrets --- .github/workflows/api_workflow.yml | 2 +- api_run.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/api_workflow.yml b/.github/workflows/api_workflow.yml index 39f2517c..32b391f5 100644 --- a/.github/workflows/api_workflow.yml +++ b/.github/workflows/api_workflow.yml @@ -115,7 +115,7 @@ jobs: fi source $HOME/.bp-venv/bin/activate - sh api_run.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "http://localhost:63342/pytest-automation-boilerplate/output/allure/reports/index.html" "${{secrets.TEAMS_WEBHOOK_URL}}" + sh api_run.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}" - name: Get Allure history uses: actions/checkout@v4 diff --git a/api_run.sh b/api_run.sh index 07812f93..bb8d7ef1 100755 --- a/api_run.sh +++ b/api_run.sh @@ -2,4 +2,5 @@ # Run API tests python -m pytest -v -s --gherkin-terminal-reporter --html="./output/reports/" --tags=$1 --self-contained-html --reruns 1 --reruns-delay 2 --alluredir=allure-results \ ---slack-webhook-url=$2 --slack-channel=pytest-test-automation --slack-results-url=$3 --teams-webhook-url=$4 --teams-results-url=$3 \ No newline at end of file +--slack-webhook-url=$2 --slack-channel=pytest-test-automation --slack-results-url=https://tweag.github.io/pytest-automation-boilerplate --teams-webhook-url=$3 \ +--teams-results-url=https://tweag.github.io/pytest-automation-boilerplate/ \ No newline at end of file