Skip to content

Commit 7638935

Browse files
committed
full smoke test
1 parent 8052ef8 commit 7638935

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

dpc-load-testing/smoke-test.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ export function runSmokeTests(data) {
4747
orgId: orgIds[idx],
4848
goldenMacaroon: data.goldenMacaroon
4949
};
50-
if (1 == 0){
51-
checkAuthWorkflow(iterationData);
52-
checkBulkExportWorkflow(iterationData);
53-
checkPatientEverythingExportWorkflow(iterationData);
54-
}
50+
checkAuthWorkflow(iterationData);
51+
checkBulkExportWorkflow(iterationData);
5552
checkPortalsWorkflow(iterationData);
53+
checkPatientEverythingExportWorkflow(iterationData);
5654
}
5755

5856
// Sets up three test organizations

dpc-load-testing/smoke_test_workflows/portals.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ import exec from 'k6/execution';
66
import http from 'k6/http';
77

88
const portals = {
9-
'admin': { envs: ['local'],
9+
'admin': { envs: ['local', 'dev', 'test', 'sandbox'],
1010
signInPath: 'admin/internal/sign_in',
1111
protectedPath: 'admin/organizations',
1212
signInText: 'Log in' },
13-
'web': { envs: ['local'],
13+
'web': { envs: ['local', 'dev', 'test', 'sandbox'],
1414
signInPath: 'users/sign_in',
1515
protectedPath: 'organizations/foo/edit',
1616
signInText: 'Log in' },
17-
// TODO: Add PACE cert when running in GHA (DPC-5222) and add 'dev' and 'test' back
18-
'portal': { envs: ['local',],
17+
'portal': { envs: ['local', 'dev', 'test'],
1918
signInPath: 'users/sign_in',
2019
protectedPath: 'organizations',
2120
signInText: 'Sign in' },
@@ -36,6 +35,7 @@ export async function checkPortalsWorkflow(data) {
3635
signInResponse,
3736
{
3837
'sign in should return 200': res => res.status == '200',
38+
'sign in should have DPC': res => res.body.includes("Data at the Point of Care"),
3939
'sign in should have sign in text': res => res.body.includes(config['signInText'])
4040
}
4141
);
@@ -44,6 +44,21 @@ export async function checkPortalsWorkflow(data) {
4444
console.error(signInResponse.body);
4545
return;
4646
}
47+
48+
const protectedPathResponse = http.get(`${host}/${config['protectedPath']}`, { redirects: 0 });
49+
const checkProtectedPath = check(
50+
protectedPathResponse,
51+
{
52+
'protected path should return 302': res => res.status == '302',
53+
'protected path has location header': res => res.headers['Location'],
54+
'protected path location header should be sign in url': res => res.headers['Location'] == signInUrl
55+
}
56+
);
57+
58+
if (!checkProtectedPath){
59+
console.error(protectedPathResponse.status);
60+
console.error(protectedPathResponse.headers);
61+
}
4762
}
4863

4964
function urlRoot(service) {

0 commit comments

Comments
 (0)