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

Fix E2E: Update region before sending the /secrets resource request #280

Merged
merged 6 commits into from
May 30, 2024

Conversation

idastambuk
Copy link
Contributor

@idastambuk idastambuk commented May 29, 2024

We were getting "Missing region" error on /secrets resource request. It looks like the delay between selecting a region and sending a the /secrets request in the test (by clicking on the Managed secret input) is too short. Adding a cy.wait(5000) seems to fix it.
Screenshot 2024-05-29 at 19 00 52

Tried decreasing it to 2000 ms but looks like that's still too short.
It's probably not the best or foolproof solution, but we will be migrating eventually to plugin-e2e

@idastambuk idastambuk marked this pull request as ready for review May 29, 2024 15:49
@idastambuk idastambuk requested a review from a team as a code owner May 29, 2024 15:49
@idastambuk idastambuk requested review from iwysiu and sarahzinger and removed request for iwysiu and sarahzinger May 29, 2024 15:49
@idastambuk idastambuk changed the title increase timeout? e2e test May 29, 2024
@idastambuk idastambuk changed the title e2e test Fix E2E: Update region before sending the /secrets resource request May 29, 2024
@idastambuk idastambuk requested review from njvrzm and sarahzinger May 29, 2024 17:09
Copy link
Contributor

@iwysiu iwysiu left a comment

Choose a reason for hiding this comment

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

If the region request is taking longer than 2 seconds, do you think it would be better to move/copy the hardcoded list to the frontend?

Copy link
Member

@sarahzinger sarahzinger left a comment

Choose a reason for hiding this comment

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

If the region request is taking longer than 2 seconds, do you think it would be better to move/copy the hardcoded list to the frontend?

Is the issue that the regions list isn't populating yet or is the issue that we need to wait for an update to be made select a region?

It sounds like we can just type any region into the input field, so I wouldn't think we'd need to wait to populate the list.

If the issue is we need to wait for an update to the region, I wonder if we can take anything filled out in progress and use that for the secrets request? That said if we want to revisit why this is slow in another pr and just fix the build here, I think that's an ok call to make.

@idastambuk
Copy link
Contributor Author

If the region request is taking longer than 2 seconds, do you think it would be better to move/copy the hardcoded list to the frontend?

Is the issue that the regions list isn't populating yet or is the issue that we need to wait for an update to be made select a region?

It sounds like we can just type any region into the input field, so I wouldn't think we'd need to wait to populate the list.

If the issue is we need to wait for an update to the region, I wonder if we can take anything filled out in progress and use that for the secrets request? That said if we want to revisit why this is slow in another pr and just fix the build here, I think that's an ok call to make.

Hmm I think I didn't explain it well, sorry! My theory theory is that when we select/write the region, it isn't updated in the datasource, so when we request the managedSecret resource (in the test, it's pretty quick), it's still empty.
It doesn't look like we currently have much control over what we pass to the resource request in the test.

@iwysiu that's a good suggestion, but I'd rather merge this to fix the build, then see if we need to do that when we migrate to plugin-e2e, if that sounds good?

@idastambuk idastambuk merged commit 22bc629 into main May 30, 2024
4 checks passed
@idastambuk idastambuk deleted the e2e-test branch May 30, 2024 12:37
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.

3 participants