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(cli): not to show 1 test when no tests are in the file #7205

Merged
merged 8 commits into from
Nov 6, 2024

Conversation

ChihweiLHBird
Copy link
Contributor

@ChihweiLHBird ChihweiLHBird commented Oct 29, 2024

This is to fix an issue that caused wing test against an empty some_file_name.w file shows Tests 1 passed (1).

See the issue #5852 for details.

Solution:
Instead of adding a dummy pass message, the function now returns early with a predefined message when there's no test case to avoid confusion later.

And I don't think it would need full E2E tests?

I am still exploring how to add test for this new test system behavior. Will mark the PR as ready after adding/updating test for it.

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

Resolves #5852

Copy link

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistance, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and standard library @chriscbr
Wing Console @skyrpex
Wing compiler and language design @chriscbr
VSCode extension and language server @chriscbr
Wing CLI @chriscbr
Documentation @boyney123
Examples @boyney123
Wing Playground @skyrpex

@ChihweiLHBird ChihweiLHBird force-pushed the zhiwei/fix-no-tests-1-count branch 2 times, most recently from 60d6a60 to 36fa8ae Compare October 29, 2024 08:41
@eladb
Copy link
Contributor

eladb commented Oct 29, 2024

@ChihweiLHBird thanks for this! Do you mind adding a few more details in the description on the bug itself and how this will look like after the fix?

@ChihweiLHBird
Copy link
Contributor Author

Hi @eladb, thanks for the suggestion! This is just a draft PR and I will mark it as ready after adding those things.

Let me know if you have any feedback or anything, for example whether this is the right way to fix it, thanks! ^_^

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Oct 29, 2024
@ChihweiLHBird ChihweiLHBird force-pushed the zhiwei/fix-no-tests-1-count branch 4 times, most recently from af8c30e to 7ad0c77 Compare November 4, 2024 00:22
@ChihweiLHBird ChihweiLHBird marked this pull request as ready for review November 4, 2024 00:22
@ChihweiLHBird ChihweiLHBird requested a review from a team as a code owner November 4, 2024 00:22
@ChihweiLHBird ChihweiLHBird marked this pull request as draft November 4, 2024 01:46
@ChihweiLHBird ChihweiLHBird changed the title fix(cli): showing 1 test when no tests are in the file fix(cli): not to show 1 test when no tests are in the file Nov 4, 2024
@ChihweiLHBird ChihweiLHBird marked this pull request as ready for review November 4, 2024 02:06
@ChihweiLHBird
Copy link
Contributor Author

Hey @eladb @Chriscbr, I think this PR is ready for reviews. And the CI reported a rate limiting error, should we try a re-run?

@eladb eladb removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Nov 5, 2024
@eladb
Copy link
Contributor

eladb commented Nov 5, 2024

@ChihweiLHBird let us know if you need any help

ChihweiLHBird and others added 4 commits November 5, 2024 13:02
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Nov 5, 2024
@ChihweiLHBird
Copy link
Contributor Author

ChihweiLHBird commented Nov 6, 2024

@eladb Does it look good to you? Or any suggestion?

@skyrpex
Copy link
Contributor

skyrpex commented Nov 6, 2024

Thanks for your contribution! I'm having a look at the CI problem here 👀 ...

@monadabot
Copy link
Contributor

❌ Unstable Self-Mutation ❌

Self-mutation has run twice in a row. There may be a something non-deterministic in the build or test process.
Check the last mutation commit (97eca6a) for suspicious changes.
This is typically caused by:

  • Absolute paths
  • Timestamps
  • Random values
  • Flakey tests (relying on one of the above)

@skyrpex skyrpex removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Nov 6, 2024
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Copy link
Contributor

mergify bot commented Nov 6, 2024

Thanks for contributing, @ChihweiLHBird! This PR will now be added to the merge queue, or immediately merged if zhiwei/fix-no-tests-1-count is up-to-date with main and the queue is empty.

@mergify mergify bot merged commit 7f00098 into winglang:main Nov 6, 2024
13 checks passed
@ChihweiLHBird ChihweiLHBird deleted the zhiwei/fix-no-tests-1-count branch November 6, 2024 15:41
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.85.32.

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.

Running wing test on an empty wing file shows 1 passed test
4 participants