Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add healthcheck function to avoid breaking tests #117

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Jonathan-Carvalheiro
Copy link
Contributor

The agent fails the JEST tests when RP is down, unreachable, or using the wrong/empty token. Added a health check to verify the connection first.

@Jonathan-Carvalheiro Jonathan-Carvalheiro force-pushed the feat/add-health-check-to-avoid-breaking-tests branch 2 times, most recently from 8c6ac9c to 3d74cc0 Compare September 30, 2022 10:43
@Jonathan-Carvalheiro Jonathan-Carvalheiro force-pushed the feat/add-health-check-to-avoid-breaking-tests branch from 3d74cc0 to 8ccf666 Compare September 30, 2022 11:53
@AmsterGet AmsterGet changed the base branch from master to develop October 31, 2022 20:58
onRunStart() {
async onRunStart() {
try {
await healthCheck(this.client);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that for one test run it will be enough to check connection once and write the connection status to the class property to check it inside of other methods.
In this case, even when the RP goes up during the test run, the reporter will not send events to a non-existent run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but the problem I found on testing that approach was, when RP is unavailable during the run, it failed the test suite even if the tests passed. So I choose to add that verification in all methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants