-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
refactor(cli/js/testing): Add a tests namespace #4387
Conversation
@bartlomieju Looks like there has been std test failures since #4381. They're not causing CI to fail. I tried |
Thanks for the heads up; I've opened #4392. We really need to get rid of |
waiting on #4373 |
ce0ff22
to
4ad9df0
Compare
41b6eba
to
eb236fa
Compare
@nayeemrmn I'll rebase and merge this PR after landing #4392 and #4397 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, waiting on @ry's approval to land
@ry Please review. |
testStart(message: TestStartMessage): Promise<void>; | ||
testEnd(message: TestEndMessage): Promise<void>; | ||
end(message: EndMessage): Promise<void>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that the test interface has become so complex that we now need to introduce a namespace to keep all the associated classes and interfaces.
It used to be just a single function.
Maybe we should work on simplifying it rather than resorting to namespaces.
Also should it be "tests" or "testing"? In std we have "std/testing".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test interface could be simplified greatly. Reporter could be a single function instead of a class. All of the message types could be reduced into one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConsoleReporter doesn't need to be exposed to the public at all.
@nayeemrmn the patch is fine, I appreciate the work, but this namespace allows the tests namespace to be more complex than it should. I want it to be ugly so are forced to simplify it back into a single function. Closing without merge. |
I have added #4450 explaining what I'd like to do instead of this patch. |
@ry There is a bit of a cleanup here that involves getting rid of an interface, if it's not too much of a baby step could this land if I removed the namespace? |
@nayeemrmn yes, happy to land cleanups. Please start a new PR and ref #4450 |
Ref #4351 (comment).
TestStatus
->tests.Status
TestResult
->tests.Result
TestEventStart
->tests.StartMessage
kind
.tests: number
->tests: TestDefinition[]
.TestEventTestStart
->tests.TestStartMessage
kind
.name: string
->test: TestDefinition
.TestEventTestEnd
->tests.TestEndMessage
kind
.TestEventEnd
->tests.EndMessage
kind
.TestStats
->tests.Stats
TestReporter
->tests.Reporter
ConsoleTestReporter
->tests.ConsoleReporter
I removed the
kind
field from the message interfaces because it is redundant in theReporter
API... then I saw it was being used for the JSON message passing inunit_test_runner.ts
. It's still correct to remove it from the message interface so I made it external.cc @bartlomieju