Skip to content

Commit

Permalink
Log all probes not returning green for the very first test executed o…
Browse files Browse the repository at this point in the history
…n the platform
  • Loading branch information
Fgerthoffert committed Jul 9, 2024
1 parent 48a5bf8 commit 77785c4
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/cypress/e2e/api/jahiaErrors.spec.begin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ import {healthCheck} from '../../support/gql';
describe('Jahia errors probe test', () => {
it('Checks that JahiaErrors probe is functional', () => {
healthCheck({severity: 'DEBUG'}).then(r => {
cy.log(JSON.stringify(r));
const jahiaErrorsProbe = r.probes.find(probe => probe.name === 'JahiaErrors');
expect(jahiaErrorsProbe.description).to.contain('Count the number of errors faced by Jahia');
expect(jahiaErrorsProbe.severity).to.eq('DEBUG');

if (jahiaErrorsProbe.status.health === 'YELLOW') {
expect(jahiaErrorsProbe.status.message).to.contain('errors are present on the platform, errors are not expected in a production environment and we recommend reviewing these.');
} else {
expect(jahiaErrorsProbe.status.message).to.contain('No errors are present on the platform');
}
cy.log(JSON.stringify(r.data?.admin?.jahia?.healthCheck?.probes.filter(probe => probe.status?.health !== 'GREEN')));
cy.then(() => {
const jahiaErrorsProbe = r.probes.find(probe => probe.name === 'JahiaErrors');
expect(jahiaErrorsProbe.description).to.contain('Count the number of errors faced by Jahia');
expect(jahiaErrorsProbe.severity).to.eq('DEBUG');

Check failure on line 11 in tests/cypress/e2e/api/jahiaErrors.spec.begin.ts

View workflow job for this annotation

GitHub Actions / Static Analysis (linting, vulns)

Trailing spaces not allowed
if (jahiaErrorsProbe.status.health === 'YELLOW') {
expect(jahiaErrorsProbe.status.message).to.contain('errors are present on the platform, errors are not expected in a production environment and we recommend reviewing these.');
} else {
expect(jahiaErrorsProbe.status.message).to.contain('No errors are present on the platform');
}

Check failure on line 16 in tests/cypress/e2e/api/jahiaErrors.spec.begin.ts

View workflow job for this annotation

GitHub Actions / Static Analysis (linting, vulns)

Trailing spaces not allowed
});
});
});

Expand Down

0 comments on commit 77785c4

Please sign in to comment.