-
Notifications
You must be signed in to change notification settings - Fork 68
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 resources are set up multiple times #661
Comments
@Rinzwind Why is your expectation that the message is only shown once? Resources are set up and torn down for every test suite and Dr. Test constructs one suite per test class. Ergo, you should see the message as many times as there are test classes that use the resource. |
Because I expected it to use a single suite like resources := OrderedCollection new.
classes do: [ :class |
| classSuite |
classSuite := class suite.
resources addAll: (classSuite resources reject: [ :resource | resources includes: resource ]).
classSuite resources: #().
suite addTest: classSuite ].
suite resources: resources. |
That will prevent overrides of |
I don’t quite follow how it would prevent overrides of |
You're right, it does work with the code you posted, sorry. I had simply patched the code to mimic what |
I opened Pharo issue #17113 about it. |
I added my feedback to the pull request. |
Given a TestResource subclass DummyTestResource with
#setUp
implemented as showing 'Setting up DummyTestResource' on the transcript, after adding DummyTestResource to the resources for SCIAbstractLoadSpecTest, the message is shown five times, rather than just once, when running the smalltalkCI tests using Pharo64-13.Reverting the change made to
#runClasses:spec:
for SCIPharoTestRunner in commit 7fed379 causes the message to only be shown once as expected (but also causes the test#testCustomTestSuite
introduced in the same commit to fail).The text was updated successfully, but these errors were encountered: