-
Notifications
You must be signed in to change notification settings - Fork 5
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
What brands should we run unit tests for in the precommit hook? #174
Comments
Pre-commit hook lives in perennial and is not related to CT. So perhaps this issue should be transferred to perennial? |
I'm not familiar with brand=phet-io unit tests, so I have no idea what the performance implications are, or how they overlap with brand=phet unit tests. Imo, the goals should be:
If running unit tests significantly impacts commit times, then we should discuss whether developers want to live with that impact, or try to develop good habits and run unit tests manually. |
Typically the brand=phet-io unit tests just add a few tests and it doesn't take much longer. For instance, in axon: brand=phet: brand=phet-io: Perhaps we should just run all tests with ?brand=phet-io. |
@zepumph what do you recommend? |
Sure seems like we should run in phet-io brand too! Do you think there is a time that would be too long? Options:
Either is fine with me. |
How about if we just run |
For everything? We could try it and see how it goes. |
When I investigated this, I saw a failure in balloons and static electricity tests locally that isn't happening on CT:
|
Balloons and static electricity is not calling qunitStart synchronously on startup, it wants to load the sim in an iframe first. But qunitStart doesn't support this. I wonder if we should switch to a pattern like https://api.qunitjs.com/config/QUnit.config // QUnit is not yet loaded here
window.QUnit = {
config: {
autostart: false,
noglobals: true,
}
}; |
I think we should switch to a lock pattern like the one that simLauncher uses. In the case of balloons and static electricity running in phet-io brand in puppeteer, there will be 3 locks:
|
In phetsims/balloons-and-static-electricity@ff4e263, balloons-and-static-electricity-tests.js was changed to call |
I think that qunitStart should not be used in BASE. Instead, since it needs custom logic, it should implement its own logic that loads everything in the order it needs. Then running only in phet-io brand feels like a good step forward for the precommit hook. I can leave myself assigned and try to get to it soon. |
Reviewing
After #191, every unit-test-enabled repo now runs successfully with |
After the above change, I tried committing this change which I expected to fail out in phet-io brand, and it didn't let me commit: Index: js/PropertyTests.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- js/PropertyTests.js (revision a09c536c544271627845cdec60a23360df746593)
+++ js/PropertyTests.js (date 1597941570664)
@@ -263,7 +263,6 @@
const getOrderDependencyLength = () => propertyStateHandlerSingleton.getNumberOfOrderDependencies() - originalOrderDependencyLength;
const firstProperty = new Property( 1, {
- tandem: parentTandem.createTandem( 'firstProperty' ),
phetioType: PropertyIO( NumberIO )
} );
const secondProperty = new Property( 1, {
|
This seems like a good solution. I tested by hacking a test in PropertyTests and saw that |
Related to phetsims/aqua#90 and from https://github.com/phetsims/phet-io/issues/1668#issuecomment-632987582,
@pixelzoom asked:
If the phet-io brand tests were a superset of all the tests, we could just run the phet-io tests. However, it is possible that phet brand tests are not a pure subset. For example, if the phet brand accidentally tries to use an object only defined in phet-io brand, this should fail, but it would pass silently.
If time were no barrier, we would run the unit tests in all brands, and probably add a "does the sim start up" test or a quick fuzz test, but we would like these precommit hooks to run quickly. Brainstorming possible ways to proceed for this issue:
@pixelzoom any other thoughts or remarks?
The text was updated successfully, but these errors were encountered: