Skip to content

test_runner: todo, only, skip are expected to return a Promise - #48555

Merged
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
shockerqt:main
Jul 3, 2023
Merged

test_runner: todo, only, skip are expected to return a Promise#48555
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
shockerqt:main

Conversation

@shockerqt

Copy link
Copy Markdown
Contributor

todo, only and skip are shorthands for test, so all of them should return the same type.

Currently todo() returns undefined while test({ todo: true }) returns a Promise that resolves to undefined.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jun 26, 2023
@MoLowMoLow linked an issue Jun 26, 2023 that may be closed by this pull request
@MoLow

MoLow commented Jun 26, 2023

Copy link
Copy Markdown
Member

The implementation looks ok, can you add a test, or modify existing tests?

@shockerqtshockerqt changed the title test: todo, only, skip are expected to return a Promisetest_runner: todo, only, skip are expected to return a PromiseJun 26, 2023
@shockerqt

Copy link
Copy Markdown
ContributorAuthor

I added a test, I'm not really sure if the structure is correct

Comment threadtest/parallel/test-runner-typechecking.js Outdated
@atlowChemi

atlowChemi commented Jun 26, 2023

Copy link
Copy Markdown
Member

@shockerqt

Copy link
Copy Markdown
ContributorAuthor

I don't know if there is a way to edit the first commit, I read the guidelines too late 😔

@atlowChemi

Copy link
Copy Markdown
Member

I don't know if there is a way to edit the first commit, I read the guidelines too late 😔

There might be another solution I am not aware of, but you could rebase, and reword the first commit:
https://git-scm.com/docs/git-rebase
https://stackoverflow.com/a/30194975
https://coderwall.com/p/_thg9a/reword-a-git-commit-message

shockerqtand others added 3 commits June 27, 2023 01:24
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.
Fixes: nodejs#48557
Added test to check that the return type of the `todo`, `only` and `skip` shorthands
are consistent with the return type of `test`.
@shockerqt

Copy link
Copy Markdown
ContributorAuthor

I don't know if there is a way to edit the first commit, I read the guidelines too late 😔

There might be another solution I am not aware of, but you could rebase, and reword the first commit: https://git-scm.com/docs/git-rebasehttps://stackoverflow.com/a/30194975https://coderwall.com/p/_thg9a/reword-a-git-commit-message

Thanks! I managed to fix the message of the first commit

@atlowChemiatlowChemi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@atlowChemiatlowChemi added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 27, 2023
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 27, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@atlowChemiatlowChemi added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 27, 2023
@atlowChemiatlowChemi added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 1, 2023
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 1, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 2, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/48555
✔ Done loading data for nodejs/node/pull/48555
----------------------------------- PR info ------------------------------------
Title test_runner: todo, only, skip are expected to return a Promise (#48555)
⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch shockerqt:main -> nodejs:main
Labels author ready, needs-ci, test_runner
Commits 3
- test_runner: fixed `test` shorthands return type
- test_runner: added tests for test shorthands
- test_runner: change tests to use `describe/it`
Committers 1
- shocker PR-URL: https://github.com/nodejs/node/pull/48555
Reviewed-By: Moshe Atlow ------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/48555
Reviewed-By: Moshe Atlow --------------------------------------------------------------------------------
ℹ This PR was created on Mon, 26 Jun 2023 04:10:55 GMT
✔ Approvals: 1
✔ - Moshe Atlow (@MoLow) (TSC): https://github.com/nodejs/node/pull/48555#pullrequestreview-1500033494
✘ This PR needs to wait 20 more hours to land (or 0 hours if there is one more approval)
✔ Last GitHub CI successful
ℹ Last Full PR CI on 2023-07-02T06:53:42Z: https://ci.nodejs.org/job/node-test-pull-request/52583/
- Querying data for job/node-test-pull-request/52583/
✔ Last Jenkins CI successful
--------------------------------------------------------------------------------
✔ Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/5435457602

@nodejs-github-botnodejs-github-bot added the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Jul 2, 2023
@MoLowMoLow added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. commit-queue Add this label to land a pull request using GitHub Actions. labels Jul 3, 2023
@nodejs-github-botnodejs-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 Jul 3, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/48555
✔ Done loading data for nodejs/node/pull/48555
----------------------------------- PR info ------------------------------------
Title test_runner: todo, only, skip are expected to return a Promise (#48555)
⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch shockerqt:main -> nodejs:main
Labels author ready, needs-ci, test_runner
Commits 3
- test_runner: fixed `test` shorthands return type
- test_runner: added tests for test shorthands
- test_runner: change tests to use `describe/it`
Committers 1
- shocker PR-URL: https://github.com/nodejs/node/pull/48555
Reviewed-By: Moshe Atlow ------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/48555
Reviewed-By: Moshe Atlow --------------------------------------------------------------------------------
ℹ This PR was created on Mon, 26 Jun 2023 04:10:55 GMT
✔ Approvals: 1
✔ - Moshe Atlow (@MoLow) (TSC): https://github.com/nodejs/node/pull/48555#pullrequestreview-1500033494
✔ Last GitHub CI successful
ℹ Last Full PR CI on 2023-07-02T07:59:05Z: https://ci.nodejs.org/job/node-test-pull-request/52583/
- Querying data for job/node-test-pull-request/52583/
✔ 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 48555
From https://github.com/nodejs/node
* branch refs/pull/48555/merge -> FETCH_HEAD
✔ Fetched commits as 1aabfa8732fb..cf59fa00fb6c
--------------------------------------------------------------------------------
[main b350b9bf63] test_runner: fixed `test` shorthands return type
Author: Shocker <43253032+shockerqt@users.noreply.github.com>
Date: Sun Jun 25 23:47:06 2023 -0400
1 file changed, 1 insertion(+), 3 deletions(-)
[main 8dd5fc58ea] test_runner: added tests for test shorthands
Author: shocker Date: Mon Jun 26 07:20:14 2023 -0400
1 file changed, 34 insertions(+)
create mode 100644 test/parallel/test-runner-typechecking.js
[main 1aa8125728] test_runner: change tests to use `describe/it`
Author: shocker Date: Mon Jun 26 21:07:55 2023 -0400
1 file changed, 26 insertions(+), 24 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: fixed test shorthands return type

test.todo, test.only and test.skip are expected to return the
same as test. This commit corrects the inconsistent behavior of
these shorthands.

Fixes: #48557
PR-URL: #48555
Reviewed-By: Moshe Atlow moshe@atlow.co.il

[detached HEAD 34e98d1da4] test_runner: fixed test shorthands return type
Author: Shocker 43253032+shockerqt@users.noreply.github.com
Date: Sun Jun 25 23:47:06 2023 -0400
1 file changed, 1 insertion(+), 3 deletions(-)
Rebasing (3/6)
Rebasing (4/6)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: added tests for test shorthands

Added test to check that the return type of the todo, only and skip shorthands
are consistent with the return type of test.

PR-URL: #48555
Reviewed-By: Moshe Atlow moshe@atlow.co.il

[detached HEAD 6de8d8de15] test_runner: added tests for test shorthands
Author: shocker fmju96@gmail.com
Date: Mon Jun 26 07:20:14 2023 -0400
1 file changed, 34 insertions(+)
create mode 100644 test/parallel/test-runner-typechecking.js
Rebasing (5/6)
Rebasing (6/6)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: change tests to use describe/it

PR-URL: #48555
Reviewed-By: Moshe Atlow moshe@atlow.co.il

[detached HEAD 4d4c40489d] test_runner: change tests to use describe/it
Author: shocker fmju96@gmail.com
Date: Mon Jun 26 21:07:55 2023 -0400
1 file changed, 26 insertions(+), 24 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/5442365030

@MoLowMoLow 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. labels Jul 3, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 3, 2023
@nodejs-github-bot
nodejs-github-bot merged commit d312bd9 into nodejs:mainJul 3, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in d312bd9

RafaelGSS pushed a commit that referenced this pull request Jul 3, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.
Fixes: #48557
PR-URL: #48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
@RafaelGSSRafaelGSS mentioned this pull request Jul 3, 2023
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.
Fixes: nodejs#48557
PR-URL: nodejs#48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.
Fixes: nodejs#48557
PR-URL: nodejs#48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
ruyadorno pushed a commit that referenced this pull request Sep 11, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.
Fixes: #48557
PR-URL: #48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
@ruyadornoruyadorno mentioned this pull request Sep 11, 2023
ruyadorno pushed a commit that referenced this pull request Sep 13, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.
Fixes: #48557
PR-URL: #48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
ruyadorno pushed a commit that referenced this pull request Sep 17, 2023
`test.todo`, `test.only` and `test.skip` are expected to return the
same as `test`. This commit corrects the inconsistent behavior of
these shorthands.
Fixes: #48557
PR-URL: #48555
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.commit-queue-failedAn error occurred while landing this pull request using GitHub Actions.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.needs-ciPRs that need a full CI run.test_runnerIssues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[node:test] Test shorthands return undefined

4 participants

@shockerqt@nodejs-github-bot@MoLow@atlowChemi