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

📦 Update dependency sinon to v10 #33418

Merged
merged 3 commits into from
Apr 27, 2021

Conversation

renovate-bot
Copy link
Contributor

@renovate-bot renovate-bot commented Mar 22, 2021

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
sinon (source) 9.2.4 -> 10.0.0 age adoption passing confidence
How to resolve breaking changes

This PR may introduce breaking changes that require manual intervention. In such cases, you will need to check out this branch, fix the cause of the breakage, and commit the fix to ensure a green CI build. To check out and update this PR, follow the steps below:

# Check out the PR branch (these steps are from GitHub)
git checkout -b renovate-bot-renovate/core-sinon-10.x main
git pull https://github.com/renovate-bot/amphtml.git renovate/core-sinon-10.x

# Directly make fixes and commit them
amp lint --fix # For lint errors in JS files
amp prettify --fix # For prettier errors in non-JS files
# Edit source code in case of new compiler warnings / errors

# Push the changes to the branch
git push git@github.com:renovate-bot/amphtml.git renovate-bot-renovate/core-sinon-10.x:renovate/core-sinon-10.x

Release Notes

sinonjs/sinon

v10.0.0

Compare Source

==================


Configuration

📅 Schedule: "after 12am every weekday" in timezone America/Los_Angeles.

🚦 Automerge: Enabled.

♻️ Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box.

This PR has been generated by WhiteSource Renovate. View repository job log here.

@erwinmombay
Copy link
Member

@rsimha do we use node lts too for windows? it seems to be throwing a error on assert.fail(`${method} is not a function`); on IE11 (for the template literal starting back tick)

@rsimha
Copy link
Contributor

rsimha commented Apr 5, 2021

do we use node lts too for windows?

Yes we do. See the Install dependencies section in the logs.

image

it seems to be throwing a error on assert.fail(`${method} is not a function`); on IE11 (for the template literal starting back tick)

This appears to be by design. There's a clue in the release notes and in the fact that the major version is changing. Looks like we need to run a babel transform against the module.

113638965-1fc7d880-9646-11eb-838b-7a7591bb0ee9

@rsimha
Copy link
Contributor

rsimha commented Apr 9, 2021

Since sinon v10 has dropped support for IE 11, we're seeing this error.

image

I took a stab at getting esbuild to transform the contents of node_modules/sinon/ along with our test code, but hit an OOM error. See logs with additional logging:

image

@jridgewell Any idea what's going on here? Do we still care enough about running a small handful of tests on IE 11? Perhaps it's time to drop IE support?

@renovate-bot renovate-bot force-pushed the renovate/core-sinon-10.x branch 2 times, most recently from 9057226 to 3b0af70 Compare April 26, 2021 23:45
@jridgewell
Copy link
Contributor

jridgewell commented Apr 27, 2021

Inspecting the output, I see on line 83 of the file run by IE11:

                    assert.fail(`${method} is not a function`);

This means we're either not transforming the file with Babel, or esbuild is outputting ES6 syntax instead of ES5.

@jridgewell
Copy link
Contributor

esbuild is set to es5:

, so we're not Babel compiling the file. Likely because of a node_modules exclusion?

@renovate-bot renovate-bot force-pushed the renovate/core-sinon-10.x branch 5 times, most recently from 5d16fb1 to ab1ece4 Compare April 27, 2021 16:18
@rsimha
Copy link
Contributor

rsimha commented Apr 27, 2021

so we're not Babel compiling the file. Likely because of a node_modules exclusion?

Correct, we weren't transforming node_modules/sinon/ earlier. When I tried doing so, esbuild threw an OOM error. See the second screenshot in #33418 (comment).

@renovate-bot renovate-bot force-pushed the renovate/core-sinon-10.x branch 6 times, most recently from c244b74 to 0c81a2a Compare April 27, 2021 18:25
@jridgewell
Copy link
Contributor

What change did you make?

@rsimha
Copy link
Contributor

rsimha commented Apr 27, 2021

What change did you make?

diff --git a/build-system/test-configs/config.js b/build-system/test-configs/config.js
index e2ea67e47..3ca9457fc 100644
--- a/build-system/test-configs/config.js
+++ b/build-system/test-configs/config.js
@@ -82,6 +82,7 @@ const karmaJsPaths = [
   'ads/**/test/test-*.js',
   'extensions/**/test/**/*.js',
   'testing/**/*.js',
+  'node_modules/sinon/**/.js',
 ];

Another thing I just noticed is that this change is introducing a silent failure on other platforms as well. For example, here. I think we should just throw an error when zero tests are detected (unlike earlier, when zero tests was a mostly harmless transitional condition). Edit: Sent out #34040 with this change.

image

@amp-owners-bot
Copy link

Hey @rsimha! These files were changed:

build-system/common/esbuild-babel.js

Copy link
Contributor

@rsimha rsimha left a comment

Choose a reason for hiding this comment

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

Bravo, @jridgewell! (And thanks for digging into the root cause.)

@jridgewell jridgewell merged commit 6718ef9 into ampproject:main Apr 27, 2021
@renovate-bot renovate-bot deleted the renovate/core-sinon-10.x branch April 27, 2021 21:29
rochapablo pushed a commit to rochapablo/amphtml that referenced this pull request Aug 30, 2021
* 📦 Update dependency sinon to v10

* Bundle and transform sinon, chai, and sinon-chai

Co-authored-by: Justin Ridgewell <jridgewell@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants