Skip to content

Commit

Permalink
Switch codes to remove missing and duplicate codes, add notes
Browse files Browse the repository at this point in the history
  • Loading branch information
plocket committed Aug 8, 2024
1 parent 5b7d9ee commit 3159f74
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ Format:

### Changed

- Moves "expected" status error to just appear for internal tests. Closes [#993](https://github.com/SuffolkLITLab/ALKiln/issues/933).
- Moves "expected" status error to only be visible to internal test errors. Closes [#993](https://github.com/SuffolkLITLab/ALKiln/issues/933).

### Fixed

- Detects failed sign in. Closes [#918](https://github.com/SuffolkLITLab/ALKiln/issues/918).

### Internal

- Adds decision docs
- Checks log codes more robustly and flexibly. See [#920](https://github.com/SuffolkLITLab/ALKiln/issues/920).
- Returns report text from `.addToReport()` so it can be used again for error messages.
- Update puppeteer to v22.15.0. Closes [#930](https://github.com/SuffolkLITLab/ALKiln/issues/930).
Expand Down
14 changes: 7 additions & 7 deletions lib/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -3040,13 +3040,13 @@ module.exports = {
await scope.afterStep(scope, {waitForShowIf: false});
} else if ( winner[0] === `failure` ) {
let error_msg = reports.addToReport( scope, {
type: `error`, code: `ALK0208`,
type: `error`, code: `ALK0209`,
value: `Failed to sign into ${ login_url }. Make sure you followed the instructions at https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#sign-in.`
});
throw new Error( error_msg );
} else if ( winner[0] === `error` ) {
let error_msg = reports.addToReport( scope, {
type: `error`, code: `ALK0213`,
type: `error`, code: `ALK0210`,
value: `Error on sign in page at ${ login_url }. Try this by hand and then run the test again.`
});
throw new Error( error_msg );
Expand All @@ -3065,7 +3065,7 @@ module.exports = {
}, { signal: controller.signal })
.catch(( error ) => {
log.debug({
code: `ALK0209`, type: `info`,
code: `ALK0204`, type: `info`,
pre: `302 sign-in wait error: ${ error.name }`,
data: error,
});
Expand All @@ -3078,7 +3078,7 @@ module.exports = {
}, { signal: controller.signal })
.catch(( error ) => {
log.debug({
code: `ALK0210`, type: `info`,
code: `ALK0205`, type: `info`,
pre: `200s sign-in wait error: ${ error.name }`,
data: error,
});
Expand All @@ -3090,7 +3090,7 @@ module.exports = {
}, { signal: controller.signal })
.catch(( error ) => {
log.debug({
code: `ALK0211`, type: `info`,
code: `ALK0206`, type: `info`,
pre: `500s sign-in wait error: ${ error.name }`,
data: error,
});
Expand All @@ -3103,7 +3103,7 @@ module.exports = {
Promise.all([ `error`, click_promise, error_promise ]),
]).catch(function ( error ) {
let error_msg = reports.addToReport( scope, {
type: `error`, code: `ALK0214`,
type: `error`, code: `ALK0207`,
value: `Unknown error waiting for results during sign in at ${ login_url }.`
});
throw new Error( error );
Expand All @@ -3113,7 +3113,7 @@ module.exports = {
controller.abort();

log.debug({
code: `ALK0212`, type: `info`,
code: `ALK0208`, type: `info`,
pre: `Sign-in winner:`, data: winner,
});

Expand Down
2 changes: 1 addition & 1 deletion lib/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ After(async function(scenario) {
throw new Error( `🤕 ${ force_failure_code } unreachable ERROR: ${ force_failure_msg }` );

} else if ( internal_errors.length > 0 ) {
log.info({ type: `internal error`, code: `ALK0208`, pre: `No need to force failed status and yet there are error messages. ${ errors.join( errors, '\n') }` });
log.info({ type: `internal error`, code: `ALK0203`, pre: `No need to force failed status and yet there are error messages. ${ errors.join( errors, '\n') }` });
}

// Find the race condition.
Expand Down

0 comments on commit 3159f74

Please sign in to comment.