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_runner: preserve original property descriptor when mutating objects #49433

Conversation

ErickWendel
Copy link
Member

In this comment, #49397 (comment) @ljharb suggested preserving the behavior and attributes of properties as they were before the modification

cc @nodejs/test_runner

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Sep 1, 2023

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Sep 1, 2023
@ErickWendel ErickWendel force-pushed the test_runner/mock-preserve-original-property-descriptor branch from 768af5c to 3fda352 Compare September 1, 2023 17:15
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

would be good to add a test or two checking enumerability, since that's likely the only thing different with this change

lib/internal/test_runner/mock/mock_timers.js Outdated Show resolved Hide resolved
@ErickWendel ErickWendel self-assigned this Sep 1, 2023
@ErickWendel
Copy link
Member Author

would be good to add a test or two checking enumerability, since that's likely the only thing different with this change

Uh, good catch! Gonna do it in a few

Signed-off-by: Erick Wendel <erick.workspace@gmail.com>
Signed-off-by: Erick Wendel <erick.workspace@gmail.com>
@ErickWendel ErickWendel force-pushed the test_runner/mock-preserve-original-property-descriptor branch from 93a9e75 to 64f872a Compare September 1, 2023 19:02
@ErickWendel
Copy link
Member Author

would be good to add a test or two checking enumerability, since that's likely the only thing different with this change

done!

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

nice, this is way cleaner

@ErickWendel ErickWendel added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 2, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 2, 2023
@nodejs-github-bot
Copy link
Collaborator

@atlowChemi atlowChemi added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 2, 2023
@nodejs-github-bot
Copy link
Collaborator

@MoLow MoLow added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 3, 2023
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Sep 3, 2023
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/49433
✔  Done loading data for nodejs/node/pull/49433
----------------------------------- PR info ------------------------------------
Title      test_runner: preserve original property descriptor when mutating objects (#49433)
Author     Erick Wendel  (@ErickWendel)
Branch     ErickWendel:test_runner/mock-preserve-original-property-descriptor -> nodejs:main
Labels     author ready, needs-ci, test_runner
Commits    3
 - test_runner: preserve original property descriptor
 - test_runner: add test for checking the property descriptor state
 - test_runner: refactoring functions
Committers 1
 - Erick Wendel 
PR-URL: https://github.com/nodejs/node/pull/49433
Reviewed-By: Benjamin Gruenbaum 
Reviewed-By: Raz Luvaton 
Reviewed-By: Chemi Atlow 
Reviewed-By: Moshe Atlow 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/49433
Reviewed-By: Benjamin Gruenbaum 
Reviewed-By: Raz Luvaton 
Reviewed-By: Chemi Atlow 
Reviewed-By: Moshe Atlow 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Fri, 01 Sep 2023 17:13:36 GMT
   ✔  Approvals: 4
   ✔  - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/49433#pullrequestreview-1608049890
   ✔  - Raz Luvaton (@rluvaton): https://github.com/nodejs/node/pull/49433#pullrequestreview-1608346449
   ✔  - Chemi Atlow (@atlowChemi): https://github.com/nodejs/node/pull/49433#pullrequestreview-1608366919
   ✔  - Moshe Atlow (@MoLow) (TSC): https://github.com/nodejs/node/pull/49433#pullrequestreview-1608411583
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2023-09-02T19:22:27Z: https://ci.nodejs.org/job/node-test-pull-request/53694/
- Querying data for job/node-test-pull-request/53694/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 49433
From https://github.com/nodejs/node
 * branch                  refs/pull/49433/merge -> FETCH_HEAD
✔  Fetched commits as 0add7a8f0c92..64f872a28f86
--------------------------------------------------------------------------------
[main 9ce045d826] test_runner: preserve original property descriptor
 Author: Erick Wendel 
 Date: Fri Sep 1 14:07:12 2023 -0300
 1 file changed, 137 insertions(+), 35 deletions(-)
[main 9a7621b25c] test_runner: add test for checking the property descriptor state
 Author: Erick Wendel 
 Date: Fri Sep 1 15:55:26 2023 -0300
 1 file changed, 49 insertions(+)
[main 2de5750354] test_runner: refactoring functions
 Author: Erick Wendel 
 Date: Fri Sep 1 15:59:39 2023 -0300
 2 files changed, 162 insertions(+), 141 deletions(-)
   ✔  Patches applied
There are 3 commits in the PR. Attempting autorebase.
Rebasing (2/6)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: preserve original property descriptor

PR-URL: #49433
Reviewed-By: Benjamin Gruenbaum benjamingr@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Chemi Atlow chemi@atlow.co.il
Reviewed-By: Moshe Atlow moshe@atlow.co.il

[detached HEAD dc9c314b0f] test_runner: preserve original property descriptor
Author: Erick Wendel erick.workspace@gmail.com
Date: Fri Sep 1 14:07:12 2023 -0300
1 file changed, 137 insertions(+), 35 deletions(-)
Rebasing (3/6)
Rebasing (4/6)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: add test for checking the property descriptor state

Signed-off-by: Erick Wendel erick.workspace@gmail.com
PR-URL: #49433
Reviewed-By: Benjamin Gruenbaum benjamingr@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Chemi Atlow chemi@atlow.co.il
Reviewed-By: Moshe Atlow moshe@atlow.co.il

[detached HEAD 496538d949] test_runner: add test for checking the property descriptor state
Author: Erick Wendel erick.workspace@gmail.com
Date: Fri Sep 1 15:55:26 2023 -0300
1 file changed, 49 insertions(+)
Rebasing (5/6)
Rebasing (6/6)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: refactoring functions

Signed-off-by: Erick Wendel erick.workspace@gmail.com
PR-URL: #49433
Reviewed-By: Benjamin Gruenbaum benjamingr@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Chemi Atlow chemi@atlow.co.il
Reviewed-By: Moshe Atlow moshe@atlow.co.il

[detached HEAD 1dc3702999] test_runner: refactoring functions
Author: Erick Wendel erick.workspace@gmail.com
Date: Fri Sep 1 15:59:39 2023 -0300
2 files changed, 162 insertions(+), 141 deletions(-)

Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/6065810018

@atlowChemi atlowChemi added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Sep 3, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 3, 2023
@nodejs-github-bot nodejs-github-bot merged commit 8e82cfc into nodejs:main Sep 3, 2023
39 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 8e82cfc

UlisesGascon pushed a commit that referenced this pull request Sep 10, 2023
PR-URL: #49433
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
@UlisesGascon UlisesGascon mentioned this pull request Sep 10, 2023
alexfernandez pushed a commit to alexfernandez/node that referenced this pull request Nov 1, 2023
PR-URL: nodejs#49433
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
targos pushed a commit that referenced this pull request Nov 27, 2023
PR-URL: #49433
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
PR-URL: nodejs/node#49433
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
PR-URL: nodejs/node#49433
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants