Skip to content

Add retries in e2e tests for Paratext login#3854

Open
Nateowami wants to merge 1 commit intomasterfrom
e2e/retry-pt-login
Open

Add retries in e2e tests for Paratext login#3854
Nateowami wants to merge 1 commit intomasterfrom
e2e/retry-pt-login

Conversation

@Nateowami
Copy link
Copy Markdown
Collaborator

@Nateowami Nateowami commented May 7, 2026

This attempts to address one of our most common failures, which is unsuccessfully logging in because the Paratext Registry wants us to use the Google login method, even though we have a email/password account.


This change is Reviewable

@Nateowami Nateowami added testing not required e2e Run e2e tests for this pull request labels May 7, 2026
@Nateowami Nateowami force-pushed the e2e/retry-pt-login branch from e7b5149 to 302caca Compare May 7, 2026 00:54
Copy link
Copy Markdown
Collaborator Author

@Nateowami Nateowami left a comment

Choose a reason for hiding this comment

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

@Nateowami made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion.


src/SIL.XForge.Scripture/ClientApp/e2e/e2e-utils.ts line 469 at r1 (raw file):

    throw new Error(`Failed to log in after ${tries} attempts`);
  }
  console.log(`Logged in as ${user.email} after ${tries} ${tries === 1 ? 'try' : 'tries'}`);

While logging is kept to a minimum in e2e tests, this is currently our biggest source of failures, so I think having visibility into whether this retry is helping is valuable.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.03%. Comparing base (786cbe1) to head (f0760ee).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3854   +/-   ##
=======================================
  Coverage   81.03%   81.03%           
=======================================
  Files         630      630           
  Lines       40586    40586           
  Branches     6584     6584           
=======================================
  Hits        32889    32889           
  Misses       6662     6662           
  Partials     1035     1035           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread src/SIL.XForge.Scripture/ClientApp/e2e/e2e-utils.ts Fixed
@Nateowami Nateowami force-pushed the e2e/retry-pt-login branch from 440af55 to f0760ee Compare May 7, 2026 02:25
@Nateowami Nateowami temporarily deployed to screenshot_diff May 7, 2026 02:31 — with GitHub Actions Inactive
@marksvc marksvc self-assigned this May 8, 2026
Copy link
Copy Markdown
Collaborator

@marksvc marksvc left a comment

Choose a reason for hiding this comment

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

Good job. I think there is a bug in the for loop.

@marksvc reviewed 1 file and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on Nateowami).


src/SIL.XForge.Scripture/ClientApp/e2e/e2e-utils.ts line 469 at r1 (raw file):

Previously, Nateowami wrote…

While logging is kept to a minimum in e2e tests, this is currently our biggest source of failures, so I think having visibility into whether this retry is helping is valuable.

👍


src/SIL.XForge.Scripture/ClientApp/e2e/e2e-utils.ts line 412 at r2 (raw file):

  let attempt = 0;
  let loginSuccessful = false;
  for (attempt++; !loginSuccessful && attempt <= 5; ) {

Shouldn't this read something like the following?

  for (attempt=1; !loginSuccessful && attempt <= 5; attempt++) {

(Or:

  let attempt = 1;
  let loginSuccessful = false;
  for (; !loginSuccessful && attempt <= 5; attempt++) {

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run e2e tests for this pull request testing not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants