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: add support for null and date value output #51920

Merged
merged 2 commits into from
Mar 2, 2024

Conversation

malthe
Copy link
Contributor

@malthe malthe commented Feb 29, 2024

This adds support for null and Date value output in the TAP test runner reporter.

Previously, a null value would not get included at all while a Date value would be rendered as an empty value.

Note that while Date objects can have properties, the v8 serialization functionality does not carry over such properties. For this reason, we don't target such values with this change.

@nodejs-github-bot
Copy link
Collaborator

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 Feb 29, 2024
@bnb
Copy link
Contributor

bnb commented Feb 29, 2024

Note that while Date objects can have properties, the v8 serialization functionality does not carry over such properties. For this reason, we don't target such values with this change.

This is probably worth adding to documentation in this PR? I can see someone being very confused about this rather easily.

@MoLow
Copy link
Member

MoLow commented Feb 29, 2024

This is probably worth adding to documentation in this PR? I can see someone being very confused about this rather easily.

what confusion can there be? this only affects how test reports present dates. it does the same thing util.inspect does

@malthe
Copy link
Contributor Author

malthe commented Feb 29, 2024

@bnb it was probably confusing to me only because I was trying to find edge cases for the purpose of writing a test case with good coverage – in real life, probably very few people will try to make assertions against such frankendates for example.

We can document it but honestly it's probably just noise for most people. It was a bit hidden how the test runner serializes your objects but at the same time, how else would it really work given that we're spawning parallel processes?

@malthe
Copy link
Contributor Author

malthe commented Feb 29, 2024 via email

This fixes an issue where a value could be `instanceof Date` without actually being a native date.

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@atlowChemi atlowChemi added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 1, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 1, 2024
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Mar 1, 2024
@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 Mar 2, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/51920
✔  Done loading data for nodejs/node/pull/51920
----------------------------------- PR info ------------------------------------
Title      test_runner: add support for null and date value output (#51920)
Author     Malthe Borch  (@malthe)
Branch     malthe:reporter-tap-null-date -> nodejs:main
Labels     author ready, needs-ci, test_runner
Commits    2
 - test_runner: add support for null and date value output
 - test_runner: use internal date check function
Committers 1
 - Malthe Borch 
PR-URL: https://github.com/nodejs/node/pull/51920
Reviewed-By: Moshe Atlow 
Reviewed-By: Chemi Atlow 
Reviewed-By: Benjamin Gruenbaum 
Reviewed-By: Antoine du Hamel 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/51920
Reviewed-By: Moshe Atlow 
Reviewed-By: Chemi Atlow 
Reviewed-By: Benjamin Gruenbaum 
Reviewed-By: Antoine du Hamel 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 29 Feb 2024 08:28:37 GMT
   ✔  Approvals: 4
   ✔  - Moshe Atlow (@MoLow) (TSC): https://github.com/nodejs/node/pull/51920#pullrequestreview-1908565190
   ✔  - Chemi Atlow (@atlowChemi): https://github.com/nodejs/node/pull/51920#pullrequestreview-1910453248
   ✔  - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/51920#pullrequestreview-1910610877
   ✔  - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/51920#pullrequestreview-1910660709
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-03-01T07:20:23Z: https://ci.nodejs.org/job/node-test-pull-request/57520/
- Querying data for job/node-test-pull-request/57520/
   ✔  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 51920
From https://github.com/nodejs/node
 * branch                  refs/pull/51920/merge -> FETCH_HEAD
✔  Fetched commits as 14293814a772..15e3f5c26172
--------------------------------------------------------------------------------
[main 0d8f8664db] test_runner: add support for null and date value output
 Author: Malthe Borch 
 Date: Wed Feb 28 12:29:45 2024 +0100
 8 files changed, 173 insertions(+), 17 deletions(-)
[main bc6a7c8bc6] test_runner: use internal date check function
 Author: Malthe Borch 
 Date: Fri Mar 1 06:39:06 2024 +0000
 1 file changed, 3 insertions(+), 3 deletions(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: add support for null and date value output

PR-URL: #51920
Reviewed-By: Moshe Atlow moshe@atlow.co.il
Reviewed-By: Chemi Atlow chemi@atlow.co.il
Reviewed-By: Benjamin Gruenbaum benjamingr@gmail.com
Reviewed-By: Antoine du Hamel duhamelantoine1995@gmail.com

[detached HEAD 914ddb0f46] test_runner: add support for null and date value output
Author: Malthe Borch mborch@gmail.com
Date: Wed Feb 28 12:29:45 2024 +0100
8 files changed, 173 insertions(+), 17 deletions(-)
Rebasing (3/4)
Rebasing (4/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: use internal date check function

This fixes an issue where a value could be instanceof Date without actually being a native date.

Co-authored-by: Antoine du Hamel duhamelantoine1995@gmail.com
PR-URL: #51920
Reviewed-By: Moshe Atlow moshe@atlow.co.il
Reviewed-By: Chemi Atlow chemi@atlow.co.il
Reviewed-By: Benjamin Gruenbaum benjamingr@gmail.com
Reviewed-By: Antoine du Hamel duhamelantoine1995@gmail.com

[detached HEAD c2e4725124] test_runner: use internal date check function
Author: Malthe Borch mborch@gmail.com
Date: Fri Mar 1 06:39:06 2024 +0000
1 file changed, 3 insertions(+), 3 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/8121573407

@aduh95 aduh95 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 Mar 2, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 2, 2024
@nodejs-github-bot nodejs-github-bot merged commit 8451990 into nodejs:main Mar 2, 2024
67 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 8451990

rdw-msft pushed a commit to rdw-msft/node that referenced this pull request Mar 26, 2024
PR-URL: nodejs#51920
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
PR-URL: #51920
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
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