Skip to content

Commit b6d32fa

Browse files
authored
Merge pull request #1215 from bcgov/feature/node-upgrade
Feature/node upgrade
2 parents 5fca87f + 39c30d4 commit b6d32fa

File tree

21 files changed

+73
-44
lines changed

21 files changed

+73
-44
lines changed

.github/workflows/aps-cypress-e2e.yaml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
workflow_dispatch: {}
55
push:
66
branches: ['test', 'cypress/*']
7+
pull_request:
8+
branches: ['dev']
79

810
env:
911
DASHBOARD_PROJECT_ID: ${{ secrets.CY_DASHBOARD_PRJ_ID }}
@@ -21,7 +23,7 @@ jobs:
2123
steps:
2224
- name: Build GWA API Image
2325
run: |
24-
git clone https://github.com/bcgov/gwa-api.git
26+
git clone https://github.com/bcgov/gwa-api.git --branch v1.0.40
2527
cd gwa-api/microservices/gatewayApi
2628
docker build -t gwa-api:e2e .
2729
@@ -47,30 +49,37 @@ jobs:
4749
4850
- name: Execute Tests & Clean Up
4951
run: |
52+
# Start following logs in the background with continuous output
53+
docker logs -f cypress-e2e 2>&1 &
54+
LOG_PID=$!
55+
5056
while true; do
5157
if [ "$(docker ps -aq -f status=exited -f name=cypress-e2e)" ]; then
58+
echo "Cypress tests completed."
5259
# cleanup
5360
docker compose down
5461
break
5562
else
56-
echo "Waiting for Cypress to Complete E2E Tests....."
57-
sleep 1m
63+
sleep 30s
5864
fi
5965
done
6066
6167
- name: Upload E2E Test Results HTML Report
68+
if: always()
6269
uses: actions/upload-artifact@v4
6370
with:
6471
name: test-results-html
6572
path: ${{ github.workspace }}/e2e/results/report
6673

6774
- name: Upload E2E Test Results JSON Report
75+
if: always()
6876
uses: actions/upload-artifact@v4
6977
with:
7078
name: test-results-json
7179
path: ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json
7280

7381
- name: Upload E2E Code Coverage Report
82+
if: always()
7483
uses: actions/upload-artifact@v4
7584
with:
7685
name: code-coverage
@@ -81,6 +90,29 @@ jobs:
8190
with:
8291
name: astra-scan-results
8392
path: ${{ github.workspace }}/e2e/cypress/fixtures/state/scanResult.json
93+
94+
- name: Check for failed tests and create Issue
95+
if: always()
96+
env:
97+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
run: |
99+
FAILURE_COUNT=$(cat ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json | jq '.stats.failures')
100+
if [[ "$FAILURE_COUNT" -gt 0 ]]; then
101+
FAILED_TESTS=$(jq -r '
102+
.results[] |
103+
(.file | split("/") | .[2:] | join("/")) as $file |
104+
.. |
105+
.tests? // empty |
106+
.[] |
107+
select(.fail == true) |
108+
"- " + $file + " - " + .title
109+
' ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json)
110+
STATS=$(cat ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json | jq -r '.stats | to_entries | map("\(.key)\t\(.value)") | .[]' | column -t)
111+
echo -e "Stats: $STATS\n\nFailed Tests:\n$FAILED_TESTS\n\nRun Link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" > msg
112+
export MSG=$(cat msg)
113+
gh issue create --title "FAILED: Automated Tests($FAILURE_COUNT)" --body "$MSG" --label "automation" --assignee "${{ env.GIT_COMMIT_AUTHOR }}"
114+
exit 1
115+
fi
84116
85117
- name: Instrument the code for coverage analysis
86118
run: |
@@ -92,7 +124,7 @@ jobs:
92124
#npx nyc instrument --compact=false . --in-place
93125
94126
- name: SonarCloud Scan
95-
uses: sonarsource/sonarcloud-github-action@master
127+
uses: sonarsource/sonarqube-scan-action@master
96128
with:
97129
args: >
98130
-Dsonar.organization=bcgov-oss
@@ -106,28 +138,6 @@ jobs:
106138
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107139
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
108140

109-
- name: Check for failed tests and create Issue
110-
env:
111-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112-
run: |
113-
FAILURE_COUNT=$(cat ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json | jq '.stats.failures')
114-
if [[ "$FAILURE_COUNT" -gt 0 ]]; then
115-
FAILED_TESTS=$(jq -r '
116-
.results[] |
117-
(.file | split("/") | .[2:] | join("/")) as $file |
118-
.. |
119-
.tests? // empty |
120-
.[] |
121-
select(.fail == true) |
122-
"- " + $file + " - " + .title
123-
' ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json)
124-
STATS=$(cat ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json | jq -r '.stats | to_entries | map("\(.key)\t\(.value)") | .[]' | column -t)
125-
echo -e "Stats: $STATS\n\nFailed Tests:\n$FAILED_TESTS\n\nRun Link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" > msg
126-
export MSG=$(cat msg)
127-
gh issue create --title "FAILED: Automated Tests($FAILURE_COUNT)" --body "$MSG" --label "automation" --assignee "${{ env.GIT_COMMIT_AUTHOR }}"
128-
exit 1
129-
fi
130-
131141
- name: Set up Python 3.9
132142
if: failure()
133143
uses: actions/setup-python@v2

.github/workflows/ci-anchore-img-scan.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
with:
1818
image: 'bcgov/api-services-portal:anchore-scan'
1919
fail-build: false
20+
output-file: 'anchore-results.sarif'
2021
- name: Upload Anchore Scan Results
2122
uses: github/codeql-action/upload-sarif@v3
2223
with:
23-
sarif_file: results.sarif
24+
sarif_file: anchore-results.sarif

.github/workflows/ci-feat-sonar.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
docker compose down
4343
4444
- name: SonarCloud Scan
45-
uses: sonarsource/sonarcloud-github-action@master
45+
uses: sonarsource/sonarqube-scan-action@master
4646
with:
4747
args: >
4848
-Dsonar.organization=bcgov-oss

.github/workflows/ci-trivy-img-scan.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
template: '@/contrib/sarif.tpl'
2525
output: 'trivy-results.sarif'
2626
- name: Upload Trivy Scan Results
27-
uses: github/codeql-action/upload-sarif@v2
27+
uses: github/codeql-action/upload-sarif@v3
2828
with:
2929
sarif_file: 'trivy-results.sarif'

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#FROM node:lts-alpine3.17
2-
FROM node:16.14.2-alpine3.15
2+
FROM node:22.12.0-alpine3.21
33

44
ARG APP_VERSION
55
ENV NEXT_PUBLIC_APP_VERSION=${APP_VERSION}

e2e/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ COPY e2e/*.yml /e2e
2222
COPY e2e/entrypoint.sh /tmp
2323
ADD e2e/cypress /e2e/cypress
2424

25-
RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/download/v3.0.4/gwa_Linux_x86_64.tgz \
25+
RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/download/v3.0.5/gwa_Linux_x86_64.tgz \
2626
&& tar -xzf gwa_Linux_x86_64.tgz \
2727
&& mv gwa /usr/local/bin/.
2828

e2e/cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default defineConfig({
2626
'./cypress/tests/07-*/*.ts',
2727
'./cypress/tests/03-*/*.ts',
2828
'./cypress/tests/04-*/*.ts',
29-
'./cypress/tests/05-*/*.ts',
29+
// './cypress/tests/05-*/*.ts',
3030
'./cypress/tests/08-*/*.ts',
3131
'./cypress/tests/09-*/*.ts',
3232
'./cypress/tests/10-*/*.ts',

e2e/cypress/tests/16-gwa-cli/02-cli-generate-config-quick-start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ describe('Verify CLI commands for generate/apply config', () => {
103103
cy.executeCliCommand('gwa gateway create --generate').then((response) => {
104104
const namespace = response.stdout.match(/\bgw-\w+/g)[0]
105105
cy.executeCliCommand(command).then((response) => {
106-
expect(response.stderr).to.contain(`Error: Service ${serviceName} is already in use. Suggestion: ${namespace}-${serviceName}`)
106+
expect(response.stderr).to.contain(`Error: Checking service availability: Service ${serviceName} is already in use. Suggestion: ${namespace}-${serviceName}`)
107107
});
108108
});
109109
})

e2e/cypress/tests/19-api-v3/03-gateways.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ describe('Gateways', () => {
188188
details: {
189189
d0: {
190190
message:
191-
'Namespace name must be between 5 and 15 alpha-numeric lowercase characters and start and end with an alphabet.',
191+
'Gateway ID must be between 5 and 15 lowercase alpha-numeric characters and start and end with a letter.',
192192
},
193193
},
194194
}

feeds/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#FROM node:lts-alpine3.17
2-
FROM node:16.14.2-alpine3.15
2+
FROM node:22.12.0-alpine3.21
33

44
RUN apk add curl jq
55

0 commit comments

Comments
 (0)