Skip to content

Commit 26626e1

Browse files
authored
Iss2190 - Enhance/fix errors in Test Simbank (#190)
* Check in credentials.properties file as they only contain dummy creds, and fix incorrect path to the tests.json report Signed-off-by: Jade Carino <[email protected]> * Update .secrets.baseline now that the Simbank credentials.properties have been checked in, they are not real secrets Signed-off-by: Jade Carino <[email protected]> --------- Signed-off-by: Jade Carino <[email protected]>
1 parent 0f782a8 commit 26626e1

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

.galasa/credentials.properties

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# File: credentials.properties
3+
#
4+
# Purpose:
5+
# To provide credentials to the Galasa runtime when running tests in a local JVM.
6+
# These credentials are used in the test.yaml Github Actions workflow.
7+
# Ordinarily credentials should NOT be checked in with source code but these
8+
# credentials are for the demo Simplatform application and not for a real system.
9+
#
10+
11+
secure.credentials.SIMBANK.username=IBMUSER
12+
secure.credentials.SIMBANK.password=SYS1

.github/workflows/test.yaml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,6 @@ jobs:
7676
brew install --no-quarantine galasactl
7777
#----------------------------------------------------------------------------------
7878
# Set up Galasa environment
79-
- name: Create credentials.properties file
80-
working-directory: ${{ env.GALASA_HOME }}
81-
run: |
82-
echo "${{ secrets.SIMBANK_CREDENTIALS }}" >> credentials.properties
83-
84-
# The credentials.properties file should look something like this:
85-
# secure.credentials.SIMBANK.username=XXX
86-
# secure.credentials.SIMBANK.password=XXX
87-
# Needs to be created dynamically as they cannot be checked into GitHub and exposed.
88-
8979
- name: Initialise local Galasa environment to create remaining files and folders
9080
run: |
9181
galasactl local init --log -
@@ -164,10 +154,9 @@ jobs:
164154
165155
#----------------------------------------------------------------------------------
166156
# Combine test reports and report to Slack channel
157+
# Skip these steps for forks. Only report results if this workflow was
158+
# called from a regression run as Main builds run multiple times a day.
167159
- name: Combine test reports
168-
# Skip this step for forks
169-
# Only report results if this workflow was called from
170-
# a regression run as Main builds run multiple times a day.
171160
if: ${{ github.repository_owner == 'galasa-dev' && github.event_name == 'workflow_dispatch' }}
172161
run: |
173162
jq -s '{ tests: map(.tests[]) }' ${{ github.workspace }}/.galasa/test-1.json ${{ github.workspace }}/.galasa/test-2.json ${{ github.workspace }}/.galasa/test-3.json > ${{ github.workspace }}/.galasa/tests.json
@@ -176,6 +165,7 @@ jobs:
176165
# We need to run a Docker image to communicate with the Slack webhook and the macos-latest
177166
# runner does not have `docker` installed. Upload the report and download in the next job.
178167
- name: Upload combined test report
168+
if: ${{ github.repository_owner == 'galasa-dev' && github.event_name == 'workflow_dispatch' }}
179169
uses: actions/upload-artifact@v4
180170
with:
181171
name: tests.json
@@ -185,9 +175,8 @@ jobs:
185175
name: Report Simbank Test results into Slack
186176
runs-on: ubuntu-latest
187177

188-
# Skip this job for forks.
189-
# Only report results if this workflow was called from
190-
# a regression run as Main builds run multiple times a day.
178+
# Skip this job for forks. Only report results if this workflow was
179+
# called from a regression run as Main builds run multiple times a day.
191180
if: ${{ github.repository_owner == 'galasa-dev' && github.event_name == 'workflow_dispatch' }}
192181

193182
needs: [build-and-run-simbank-tests]
@@ -206,7 +195,7 @@ jobs:
206195
run: |
207196
docker run --rm \
208197
--env SLACK_WEBHOOK=${{ env.SLACK_WEBHOOK }} \
209-
-v ${{ github.workspace }}/.galasa/temp:/galasa:rw \
198+
-v ${{ github.workspace }}/.galasa:/galasa:rw \
210199
ghcr.io/${{ env.NAMESPACE }}/galasabld-ibm:main \
211200
slackpost tests \
212201
--path /galasa/tests.json \

.secrets.baseline

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@
8686
"verified_result": null
8787
}
8888
],
89-
".github/workflows/test.yaml": [
89+
".galasa/credentials.properties": [
9090
{
91-
"hashed_secret": "b60d121b438a380c343d5ec3c2037564b82ffef3",
91+
"hashed_secret": "fe44766d64874d9f668bc0e054d56893a9d3cdb0",
9292
"is_secret": false,
9393
"is_verified": false,
94-
"line_number": 85,
94+
"line_number": 12,
9595
"type": "Secret Keyword",
9696
"verified_result": null
9797
}

0 commit comments

Comments
 (0)