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

Tests - update test command to show failures #7400

Open
wants to merge 11 commits into
base: dev/feature
Choose a base branch
from

Conversation

ShaneBeee
Copy link
Contributor

@ShaneBeee ShaneBeee commented Jan 6, 2025

Description

This PR aims to fix the /sk test command that doesn't show failed tests.

NOTE:
Im not 100% sure this is the best way to do things, so Im open to feedback.

Part One:

When running /sk test something, it would show a test as passed even though there was a parse error.
Exhibit A:
Screenshot 2025-01-05 at 3 55 19 PM

Now you might be thinking "But Shane, you can see the error right there"
Yes, that is true, but if you run a bunch of tests, not as easy to see.
Also, it still shows the test as a pass, but in reality it didn't pass.
Exhibit B:
"Yay everything looks good...."
Screenshot 2025-01-05 at 3 55 59 PM
"Well, I shouldn't have scrolled up.
Screenshot 2025-01-05 at 3 56 18 PM

So to fix this, I created a custom log handler for testing, TestingLogHandler, and added in some stuff to actually log the parse errors for the tests.
Exhibit C:
"Yay, now I know my test[s] failed"
Screenshot 2025-01-05 at 3 57 59 PM
Screenshot 2025-01-05 at 3 58 17 PM

This also fixes them not showing up in the json file.
Screenshot 2025-01-05 at 4 05 52 PM

Part Two:

A lovely side effect of this test is that it also helps users easily spot parsing errors.
These were run with quickTest

BEFORE:

"What? Where are these errors? I need details 😢"
Screenshot 2025-01-05 at 3 26 53 PM

AFTER:

"Omg there it is... test... script... line and all, oh happy day 😃"
Screenshot 2025-01-05 at 3 28 15 PM

Part Three:

I gave the lists some hyphens, to make them look like lists, and add "none" when said list is empty.

Screenshot 2025-01-05 at 4 25 29 PM

Part Four:

This one is small:
}, TestMode.DEV_MODE ? 0 : 50);
Remove the delay starting the test environment if in DEV_MODE!


Target Minecraft Versions: any
Requirements: none
Related Issues: #7399

Copy link
Contributor

@TheAbsolutionism TheAbsolutionism left a comment

Choose a reason for hiding this comment

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

I very much like this!

@cheeezburga cheeezburga added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants