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 build failure #105

Merged
merged 18 commits into from
Nov 27, 2019
Merged

Fix build failure #105

merged 18 commits into from
Nov 27, 2019

Conversation

JuanMaRuiz
Copy link
Contributor

Although the coverage of psi is great

test-coverage

I think there are some minor changes that could be included in order to have more stable tests.

In the last PR we had some problems in the test, marking the build as instable, due a connection with the API. Another problem, related with travis and web requests was solved in the pass.

If we take a look to api-response.test.js we see that tests are:

  • Connecting with the real API.
  • Checking the response from the API.

From my point of view we should avoid this call to the real API and test should check the methods instead.

This PR contains several changes that try to solve that.

Hope it helps.

Best regards.

@JuanMaRuiz JuanMaRuiz mentioned this pull request Nov 18, 2019
Copy link
Collaborator

@exterkamp exterkamp left a comment

Choose a reason for hiding this comment

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

Great tests 👍 🎉

I think I still like the idea of integration testing with the real API. Tbh it was a good test, it kept failing due to the API itself being flaky, which definitely helped me in diagnosing the underlying errors.

nit: changing the wording of the test methods

test/api-response.test.js Outdated Show resolved Hide resolved
test/index.test.js Outdated Show resolved Hide resolved
test/output.test.js Outdated Show resolved Hide resolved
JuanMaRuiz and others added 4 commits November 21, 2019 18:51
Co-Authored-By: Shane Exterkamp <shaneexterkamp5@gmail.com>
Co-Authored-By: Shane Exterkamp <shaneexterkamp5@gmail.com>
Copy link
Collaborator

@exterkamp exterkamp left a comment

Choose a reason for hiding this comment

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

I talked to another dev (hi @connorjclark) and I think we both agreed that the more simple solution to the monkey-patching of handleOpts and getThreshold would be to just modules.export them to test them directly without rewire. I think exporting would be better than adding another dependency.

Sorry for the 11th hour feedback 😃

@JuanMaRuiz
Copy link
Contributor Author

No problem, I think is a better solution. The initial idea was not changing the original code too much, but I prefer your solution.

Best regards.

Copy link
Collaborator

@exterkamp exterkamp left a comment

Choose a reason for hiding this comment

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

LGTM. If you want to make the 1 final change I called it out, but not a dealbreaker.

Otherwise I'll land this.

lib/output.js Show resolved Hide resolved
@exterkamp exterkamp merged commit 9949c6c into GoogleChromeLabs:master Nov 27, 2019
@exterkamp
Copy link
Collaborator

Pro

🙏 image 🙏

@JuanMaRuiz JuanMaRuiz deleted the feature-optimizing-test branch November 27, 2019 22:45
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