Skip to content

Commit ce32b74

Browse files
Merge pull request #281 from IMDA-BTG/test-for-release-v0.10.2
Test & Merge for Release v0.10.2 The requested reviews are Approved. Proceeded to merge PR to Main.
2 parents d48d624 + f8c2591 commit ce32b74

File tree

121 files changed

+6373
-5493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+6373
-5493
lines changed

.github/workflows/integration-tests-docker.yml

Lines changed: 63 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,39 @@ jobs:
3030
integration-tests-docker:
3131

3232
runs-on: ubuntu-latest
33-
timeout-minutes: 40
33+
timeout-minutes: 100
3434

3535
steps:
3636

37-
- name: Checkout code
37+
- name: Checkout Code (Workflow_Dispatch)
38+
if: github.event_name == 'workflow_dispatch'
3839
uses: actions/checkout@v3
3940
with:
4041
ref: ${{ inputs.branch_to_test }}
41-
sparse-checkout: |
42-
setup-aiverify
4342

44-
- name: Build aiverify docker image
43+
- name: Checkout Code (Pull_Request_Review)
44+
if: github.event_name == 'pull_request_review'
45+
uses: actions/checkout@v3
46+
with:
47+
ref: ${{ github.event.pull_request.head.ref }}
48+
repository: ${{ github.event.pull_request.head.repo.full_name }}
49+
submodules: recursive
50+
51+
- name: Build AI Verify Docker Image (Workflow_Dispatch)
52+
if: github.event_name == 'workflow_dispatch'
53+
working-directory: ${{ github.workspace }}/setup-aiverify
54+
run: |
55+
cd aiverify-user
56+
echo ${{ inputs.branch_to_test }}
57+
bash docker-build.sh --build-arg=BRANCH_TAG=${{ inputs.branch_to_test }}
58+
59+
- name: Build AI Verify Docker Image (Pull_Request_Review)
60+
if: github.event_name == 'pull_request_review'
4561
working-directory: ${{ github.workspace }}/setup-aiverify
4662
run: |
4763
cd aiverify-user
48-
bash docker-build.sh --build-arg=BRANCH_TAG=${{ inputs.branch_to_test }} --build-arg=ALLOWED_ORIGINS="http://localhost:3000,http://localhost:4000,http://127.0.0.1:3000,http://127.0.0.1:4000,http://127.0.0.1:27017"
64+
echo ${{ inputs.branch_to_test }}
65+
bash docker-build.sh --build-arg=BRANCH_TAG=${{ github.event.pull_request.head.ref }}
4966
5067
- name: Run aiverify containers
5168
working-directory: ${{ github.workspace }}/setup-aiverify
@@ -72,63 +89,61 @@ jobs:
7289
docker-compose up -d
7390
fi
7491

75-
# - name: Checkout API Mock Server
76-
# uses: actions/checkout@v3
77-
# with:
78-
# repository: IMDA-BTG/api-model-server
79-
# token: ${{ secrets.CHECKOUT_TOKEN }}
80-
# ref: main
81-
# path: qa-test/api-model-server
82-
83-
# - name: Checkout smoke tests
84-
# uses: actions/checkout@v3
85-
# with:
86-
# repository: IMDA-BTG/smoke-testing
87-
# token: ${{ secrets.CHECKOUT_TOKEN }}
88-
# ref: main
89-
# path: qa-test/smoke-testing
92+
- name: Checkout API Mock Server
93+
uses: actions/checkout@v3
94+
with:
95+
repository: IMDA-BTG/api-model-server
96+
ref: main
97+
path: qa-test/api-model-server
98+
99+
- name: Checkout smoke tests
100+
uses: actions/checkout@v3
101+
with:
102+
repository: IMDA-BTG/smoke-testing
103+
ref: main
104+
path: qa-test/smoke-testing
105+
submodules: recursive
90106

91107
- name: Checkout frontend tests
92108
uses: actions/checkout@v3
93109
with:
94110
repository: IMDA-BTG/frontend-testing
95-
token: ${{ secrets.CHECKOUT_TOKEN }}
96111
ref: main
97112
path: qa-test/frontend-testing
113+
submodules: recursive
98114

99-
# - name: Checkout backend tests
100-
# uses: actions/checkout@v3
101-
# with:
102-
# repository: IMDA-BTG/backend-testing
103-
# token: ${{ secrets.CHECKOUT_TOKEN }}
104-
# ref: main
105-
# path: qa-test/backend-testing
106-
# submodules: recursive
115+
- name: Checkout backend tests
116+
uses: actions/checkout@v3
117+
with:
118+
repository: IMDA-BTG/backend-testing
119+
ref: main
120+
path: qa-test/backend-testing
121+
submodules: recursive
107122

108-
# - name: Run API Mock Server
109-
# if: ${{ ! cancelled() }}
110-
# run: |
111-
# cd qa-test/api-model-server
112-
# python3 -m venv venv
113-
# source venv/bin/activate
114-
# pip3 install -r requirements.txt
115-
# bash regression_run_https.sh && fg &
116-
# bash classification_run_https.sh &
117-
118-
# - name: Run smoke tests
119-
# if: ${{ ! cancelled() }}
120-
# run: |
121-
# cd qa-test/smoke-testing
122-
# npm install
123-
# npx playwright install
124-
# ENVIRONMENT_URL=$ENVIRONMENT_URL npx playwright test
123+
- name: Run API Mock Server
124+
if: ${{ ! cancelled() }}
125+
run: |
126+
cd qa-test/api-model-server
127+
python3 -m venv venv
128+
source venv/bin/activate
129+
pip3 install -r requirements.txt
130+
bash regression_run_https.sh && fg &
131+
bash classification_run_https.sh &
132+
133+
- name: Run smoke tests
134+
if: ${{ ! cancelled() }}
135+
run: |
136+
cd qa-test/smoke-testing
137+
npm install
138+
npx playwright install
139+
ENVIRONMENT_URL=https://host.docker.internal npx playwright test
125140
126141
- name: Run frontend tests
127142
if: ${{ ! cancelled() }}
128143
run: |
129144
cd qa-test/frontend-testing
130145
npm install
131-
npx playwright test
146+
ENVIRONMENT_URL=https://host.docker.internal npx playwright test
132147
133148
# - name: Run backend tests
134149
# if: ${{ ! cancelled() }}

.github/workflows/integration-tests.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ jobs:
5959
admin = db.getSiblingDB('admin')
6060
admin.createUser({
6161
user: 'mongodb',
62-
pwd: 'mongodb',
62+
pwd: 't1oj5L_xQI8dTrVuZ',
6363
roles: [{ role: 'root', db: 'admin' }],
6464
});
6565
6666
aiverify = db.getSiblingDB('aiverify')
6767
aiverify.createUser({
6868
user: 'aiverify',
69-
pwd: 'aiverify',
69+
pwd: 't1oj5L_xQI8dTrVuZ',
7070
roles: [{ role: 'readWrite', db: 'aiverify' }],
7171
});
7272
@@ -169,7 +169,7 @@ jobs:
169169
DB_HOST=127.0.0.1
170170
DB_PORT=27017
171171
DB_USERNAME=aiverify
172-
DB_PASSWORD=aiverify
172+
DB_PASSWORD=t1oj5L_xQI8dTrVuZ
173173
ALLOWED_ORIGINS=http://127.0.0.1:3000,http://127.0.0.1:3001,http://127.0.0.1:4000" > .env
174174
175175
node app.mjs &> apigw.log &
@@ -181,7 +181,6 @@ jobs:
181181
uses: actions/checkout@v3
182182
with:
183183
repository: IMDA-BTG/api-model-server
184-
token: ${{ secrets.CHECKOUT_TOKEN }}
185184
ref: main
186185
path: qa-test/api-model-server
187186

@@ -198,15 +197,13 @@ jobs:
198197
uses: actions/checkout@v3
199198
with:
200199
repository: IMDA-BTG/frontend-testing
201-
token: ${{ secrets.CHECKOUT_TOKEN }}
202200
ref: main
203201
path: qa-test/frontend-testing
204202

205203
- name: Checkout backend tests
206204
uses: actions/checkout@v3
207205
with:
208206
repository: IMDA-BTG/backend-testing
209-
token: ${{ secrets.CHECKOUT_TOKEN }}
210207
ref: main
211208
path: qa-test/backend-testing
212209
submodules: recursive
@@ -234,7 +231,7 @@ jobs:
234231
run: |
235232
cd qa-test/frontend-testing
236233
npm install
237-
npx playwright test
234+
ENVIRONMENT_URL=https://127.0.0.1 npx playwright test
238235
239236
- name: Run backend tests
240237
if: ${{ ! cancelled() }}

.github/workflows/sca-scan.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# SCA Scan
2+
3+
name: Software Composition Analysis
4+
5+
on:
6+
# Runs when a pull request review is being submitted
7+
pull_request_review:
8+
types: [submitted]
9+
branches:
10+
- 'main'
11+
- 'v0.*'
12+
13+
# Run this workflow manually from Actions tab
14+
workflow_dispatch:
15+
inputs:
16+
branch_to_test:
17+
description: 'Branch or tag to run test'
18+
required: true
19+
default: 'main'
20+
type: string
21+
22+
# Allow one concurrent deployment
23+
concurrency:
24+
group: ${{ github.repository }}-${{ github.workflow }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
software-composition-analysis:
29+
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 10
32+
33+
steps:
34+
35+
- name: Checkout Code (Pull_Request_Review)
36+
if: github.event_name == 'pull_request_review'
37+
uses: actions/checkout@v3
38+
with:
39+
ref: ${{ github.event.pull_request.head.ref }}
40+
repository: ${{ github.event.pull_request.head.repo.full_name }}
41+
submodules: recursive
42+
43+
- name: Install & Scan APIGW
44+
run: |
45+
cd ai-verify-apigw
46+
npm install
47+
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=ai-verify-apigw --detect.project.version.name=$(date +"%d-%m-%Y") --detect.source.path=. --detect.code.location.name="ai-verify-apigw_$(date +"%d-%m-%Y")" --detect.excluded.directories=/tests --blackduck.trust.cert=true
48+
cd ../
49+
50+
- name: Install & Scan PORTAL
51+
run: |
52+
cd ai-verify-portal
53+
npm install
54+
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=ai-verify-portal --detect.project.version.name=$(date +"%d-%m-%Y") --detect.source.path=. --detect.code.location.name="ai-verify-portal_$(date +"%d-%m-%Y")" --detect.excluded.directories=/tests --blackduck.trust.cert=true
55+
cd ../
56+
57+
- name: Install & Scan SHARED LIBRARY
58+
run: |
59+
cd ai-verify-shared-library
60+
npm install
61+
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=ai-verify-shared-library --detect.project.version.name=$(date +"%d-%m-%Y") --detect.source.path=. --detect.code.location.name="ai-verify-shared-library_$(date +"%d-%m-%Y")" --detect.excluded.directories=/tests --blackduck.trust.cert=true
62+
cd ../
63+
64+
- name: Install & Scan TEST ENGINE APP
65+
run: |
66+
cd test-engine-app
67+
python3 -m venv venv
68+
source venv/bin/activate
69+
pip install -r requirements.txt
70+
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=test-engine-app --detect.project.version.name=$(date +"%d-%m-%Y") --detect.source.path=. --detect.code.location.name="test-engine-app_$(date +"%d-%m-%Y")" --detect.excluded.directories=/tests --blackduck.trust.cert=true
71+
cd ../
72+
73+
- name: Install & Scan TEST ENGINE CORE
74+
run: |
75+
cd test-engine-core
76+
python3 -m venv venv
77+
source venv/bin/activate
78+
pip install -r requirements.txt
79+
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=test-engine-core --detect.project.version.name=$(date +"%d-%m-%Y") --detect.source.path=. --detect.code.location.name="test-engine-core_$(date +"%d-%m-%Y")" --detect.excluded.directories=/tests --blackduck.trust.cert=true
80+
cd ../
81+
82+
- name: Install & Scan TEST ENGINE CORE MODULES
83+
run: |
84+
cd test-engine-core-modules
85+
python3 -m venv venv
86+
source venv/bin/activate
87+
pip install -r requirements.txt
88+
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=test-engine-core-modules --detect.project.version.name=$(date +"%d-%m-%Y") --detect.source.path=. --detect.code.location.name="test-engine-core-modules_$(date +"%d-%m-%Y")" --detect.excluded.directories=/tests --blackduck.trust.cert=true
89+
cd ../
90+
91+
- name: Install & Scan STOCK PLUGINS
92+
run: |
93+
cd stock-plugins
94+
python3 -m venv venv
95+
source venv/bin/activate
96+
find ./ -type f -name 'requirements.txt' -exec pip install -r "{}" \;
97+
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=test-engine-core --detect.project.version.name=$(date +"%d-%m-%Y") --detect.source.path=. --detect.code.location.name="stock-plugins_$(date +"%d-%m-%Y")" --detect.excluded.directories=/tests --blackduck.trust.cert=true
98+
cd ../

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
[![Integration Tests](https://github.com/IMDA-BTG/aiverify/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/IMDA-BTG/aiverify/actions/workflows/integration-tests.yml)
2+
[![Integration Tests](https://github.com/IMDA-BTG/aiverify/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/IMDA-BTG/aiverify/actions/workflows/integration-tests.yml) [![Integration Tests for aiverify-user (Docker)](https://github.com/IMDA-BTG/aiverify/actions/workflows/integration-tests-docker.yml/badge.svg)](https://github.com/IMDA-BTG/aiverify/actions/workflows/integration-tests-docker.yml)
33

44
## ✨New API Connector Feature!
55

@@ -67,7 +67,7 @@ Thank you for your interest in AI Verify, and we look forward to your contributi
6767

6868
```
6969
AI Verify
70-
Copyright 2023 AI Verify Foundation
70+
Copyright 2024 AI Verify Foundation
7171
7272
This product includes software developed under the AI Verify Foundation.
7373

ai-verify-apigw/__tests__/graphql/dataset.test.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe("Test Dataset GraphQL queries and mutations", () => {
128128
const response2 = await server.executeOperation({
129129
query,
130130
variables: {
131-
datasetID: mongoose.Types.ObjectId(),
131+
datasetID: new mongoose.Types.ObjectId(),
132132
dataset: {
133133
description: 'Mock Description2',
134134
name: 'New File Name2.png',
@@ -141,7 +141,7 @@ describe("Test Dataset GraphQL queries and mutations", () => {
141141
expect(response2.body.singleResult.errors).toBeDefined();
142142

143143
// check not updated into db
144-
const doc = await DatasetModel.findOne({ _id: mongoose.Types.ObjectId(id) });
144+
const doc = await DatasetModel.findOne({ _id: new mongoose.Types.ObjectId(id) });
145145
expect(doc.name).toEqual(data[dataLen-1].name);
146146
expect(doc.status).toEqual(data[dataLen-1].status);
147147

@@ -177,7 +177,7 @@ describe("Test Dataset GraphQL queries and mutations", () => {
177177
expect(response.body.singleResult.errors).toBeUndefined();
178178

179179
// check updated into db
180-
const doc = await DatasetModel.findOne({ _id: mongoose.Types.ObjectId(id) });
180+
const doc = await DatasetModel.findOne({ _id: new mongoose.Types.ObjectId(id) });
181181
expect(doc.name).toEqual('New File Name.png');
182182
expect(doc.status).toEqual('Cancelled');
183183
expect(doc.description).toEqual('Mock Description');
@@ -284,7 +284,7 @@ describe("Test Dataset GraphQL queries and mutations", () => {
284284
response = await server.executeOperation({
285285
query,
286286
variables: {
287-
id: mongoose.Types.ObjectId()
287+
id: new mongoose.Types.ObjectId()
288288
}
289289
})
290290
// check response

0 commit comments

Comments
 (0)