Comments (19)
@pixelzoom can I create a scenery issue for #31 (comment) and close this issue?
from aqua.
Why do we need to run unit tests with assertions disabled?
from aqua.
It may be unnecessary to run unit tests with assertions disabled. Is there a class of errors that only manifests when assertions are off? If so, is it a frequent enough kind of error that we need to run tests with assertions disabled?
from aqua.
Is there a class of errors that only manifests when assertions are off? If so, is it a frequent enough kind of error that we need to run tests with assertions disabled?
The only one I can think of is failure to use assert &&
before a call to assert
. And that will certainly be noticed outside of unit tests.
from aqua.
The proposal to only run unit tests with assertions enabled sounds reasonable to me, but I want to run it past @jonathanolson before we proceed.
from aqua.
If you must use this pattern:
if ( !window.assert ) {
assert.expect( n );
}
... then you shouldn't be assuming that there are n tests that don't involve window.assert
. You should be keeping a counter that gets incremented whenever any test is run, then check the counter:
assert.expect( numberOfTestsRun );
And yes, that sounds like a colossal error-prone pain.
from aqua.
If we do decide to run tests with assertions enabled, then tests should verify that assert
is enabled.
from aqua.
We are also planning to run unit tests on compiled code, where assertions cannot be enabled.
from aqua.
We are also planning to run unit tests on compiled code, where assertions cannot be enabled.
Presumably only for scenery/kite/dot, not the simulations/runnables?
from aqua.
I'm getting confused. In this thread: #28 (comment)
@jonathanolson and I spoke this morning and decided we will skip the built tests for now. We haven't seen a "built-only" bug for a while so we will defer for now.
I meant only scenery/kite/dot. I think we do still occasionally see built sim issues. That looks like it was removed (I restarted on bayes).
Did you mean "We will only skip scenery/kite/dot and will continue to test built sims, since we see issues there"?
from aqua.
I'm removing the call to assert.expect( 5 )
in NumberProperty, since it is unnecessary and confuses this discussion. Slack discussion with @samreid:
Chris Malley [10:27 AM]
I want to make sure that I understand assert.expect. Is the call in NumberPropertyTests necessary? I think not.
Sam Reid [10:29 AM]
It is not necessary because there is at least one other non-short-circuited assert.* call
Chris Malley [10:29 AM]
My understanding is that we only need assert.expect(0) to handle the case where no tests are run.
Sam Reid [10:29 AM]
For instance, the one on line 43 handles it.
Chris Malley [10:29 AM]
OK if I remove it?
Sam Reid [10:29 AM]
yes please
from aqua.
Sam Reid [10:31 AM]
We could avoid the assert.expect() altogether if we add at least one non-short-circuited assert.* call to each test. Should we do that too?
Chris Malley [10:32 AM]
I think having a “dummy” test that is always run and succeeds is preferrable to having assert.expect(0). But surely someone else must have run into this problem….
from aqua.
assert.ok( true, 'so we have at least 1 test in this set' );
from aqua.
@jonathanolson I assume that this is also unnecessary in TrailTests.js:
680 // this may change if for some reason we end up calling more events in the future
681 assert.expect( 4 );
OK to remove it?
from aqua.
In TrailTests.js the assert.expect( 4 )
is checking that exactly 4 of the preceding 6 callbacks were called--it may be necessary (though I must admit I don't understand why we would only expect 4 of those 6 callbacks).
from aqua.
Mind if I replace all assert.expect( 0 )
with assert.ok( true, 'so we have at least 1 test in this set' );
? I wasn’t sure if you are working on it or not.
from aqua.
@pixelzoom gave me the go-ahead on slack
from aqua.
I replaced expect( 0 )
with the synthetic test.
from aqua.
I created phetsims/scenery#720, closing.
from aqua.
Related Issues (20)
- CTQ status is not reliably reported to Slack#continouous-testing HOT 13
- Make this repo private HOT 3
- pm2 in cluster mode instead of `grunt client-server`? HOT 1
- Improve ct-main server HOT 2
- ct-chrome-clients should run on sparky and bayes together HOT 2
- report should show percent of tests completed in column heading HOT 3
- Increase the size of `/tmp` in sparky HOT 3
- Better error reporting for window.location probably changed (onbeforeunload handler) HOT 11
- Support WebGL on sparky HOT 3
- CTQ should slack report when erroring out or quiting
- CT: Improve memory testing
- CT report filter should match on error messages too HOT 1
- Make a Node-based CT client HOT 15
- Investigate tests that are not completing: HOT 3
- New snapshots should be transpiled before starting tests HOT 1
- Handle 414 errors HOT 4
- CT: `TypeError: tn() is not a constructor` HOT 1
- CT: unhandledRejection from non 200 status code
- CT: net::ERR_FAILED in phet-io-wrappers-tests HOT 20
- QuickServer should always lint without cache HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aqua.