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

test: api mocking wip #1530

Merged
merged 7 commits into from
Apr 12, 2022
Merged

test: api mocking wip #1530

merged 7 commits into from
Apr 12, 2022

Conversation

clockworkgr
Copy link
Collaborator

Description

Please include a summary of the change and which issue(s) is/are fixed.

Fixes: # (issue)

Feature flags

Please mention the feature flags to be used for testing.

Testing

Please provide the steps for testing this PR.


Additional Details (Optional)

For additional details.

Reviews (Optional)

Please mention developer(s) who should definitely review this change. Use this when your code would be used by a larger component or modifies core functionality or modifies an existing component being used in a lot of places etc.

Screenshots (Optional)

Please attach screenshots if required.

@cloudflare-pages
Copy link

cloudflare-pages bot commented Apr 7, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: bb58d24
Status: ✅  Deploy successful!
Preview URL: https://27aa751d.emeris-app.pages.dev

View logs

Comment on lines 6 to 9
page.route('https://api.emeris.com/**/*', mockHandler);
page.on('domcontentloaded', () => {
page.evaluate('window.Cypress=true; window.chrome=true; window.keplr={}');
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we import this to centralize in one file as it seems repeated in all test files?

@caudurodev
Copy link
Contributor

Not sure if this PR is addressing all issues, but FYI, I consistently still get flaky tests when running locally:
image

1 similar comment
@caudurodev
Copy link
Contributor

Not sure if this PR is addressing all issues, but FYI, I consistently still get flaky tests when running locally:
image

eitjuh
eitjuh previously requested changes Apr 8, 2022
Copy link
Contributor

@eitjuh eitjuh left a comment

Choose a reason for hiding this comment

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

I feel this is a regression because we are using the mocks by default...
Can't we make it an option? So that we can only use the mocks when backend stability is causing our tests to fail?

That we can ourselves choose
"use the real data" or "use the mocks"?

@clockworkgr
Copy link
Collaborator Author

I feel this is a regression because we are using the mocks by default... Can't we make it an option? So that we can only use the mocks when backend stability is causing our tests to fail?

That we can ourselves choose "use the real data" or "use the mocks"?

I'm not gonna enable it just yet....it's enabled to test the ci.

Will only add it on specific tests going forward

@clockworkgr
Copy link
Collaborator Author

Not sure if this PR is addressing all issues, but FYI, I consistently still get flaky tests when running locally: image

are you on the latest?

portfolio test needed changes as data had changed...latest commit should have fixed all issues

@eitjuh
Copy link
Contributor

eitjuh commented Apr 8, 2022

I get the same result:
image

Alex by the way promised me to remove page.route('https://api.emeris.com/**/*', mockHandler); before merging, because we only plan to use it with specific tests, so don't want to "request changes" anymore

@eitjuh eitjuh dismissed their stale review April 8, 2022 09:23

won't be merged with "page.route('https://api.emeris.com/**/*', mockHandler);"

@clockworkgr
Copy link
Collaborator Author

I get the same result: image

Alex by the way promised me to remove page.route('https://api.emeris.com/**/*', mockHandler); before merging, because we only plan to use it with specific tests, so don't want to "request changes" anymore

youre running with staking/tx center/mnemonic env flags on right?

@eitjuh
Copy link
Contributor

eitjuh commented Apr 12, 2022

I get the same result: image
Alex by the way promised me to remove page.route('https://api.emeris.com/**/*', mockHandler); before merging, because we only plan to use it with specific tests, so don't want to "request changes" anymore

youre running with staking/tx center/mnemonic env flags on right?

Yesss, anything specific my .env.local mnemonic should have? Specific assets?

@clockworkgr
Copy link
Collaborator Author

I get the same result: image
Alex by the way promised me to remove page.route('https://api.emeris.com/**/*', mockHandler); before merging, because we only plan to use it with specific tests, so don't want to "request changes" anymore

youre running with staking/tx center/mnemonic env flags on right?

Yesss, anything specific my .env.local mnemonic should have? Specific assets?

wait...youre not using the mnemonic monterail had?

@clockworkgr clockworkgr merged commit 9e756a5 into production Apr 12, 2022
@eitjuh eitjuh deleted the tests/mock-api-framework branch April 12, 2022 12:46
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.

None yet

3 participants