Conversation
|
Wonderful, Firefox doesn't work because of a 6-year-old bug: microsoft/playwright#21783 |
| colorGrade.saturation = -1; | ||
| await timePasses(20); | ||
| await composer.updateComplete; | ||
| await rafPasses(); |
There was a problem hiding this comment.
@diegoteran This is a common technique for deflaking tests - waiting an arbitrary amount of time is nearly always a recipe for a flaky test. If you can find the right thing to await, it starts working reliably. I fixed some like this, but a bunch of others I just skiped, so we'll need to come back later and try these kinds of fixes.
| import { Renderer } from '@google/model-viewer/lib/three-components/Renderer.js'; | ||
| const expect = chai.expect; | ||
| import {expect} from '@esm-bundle/chai'; | ||
| import {ModelViewerElement} from '@google/model-viewer'; |
There was a problem hiding this comment.
I think the contributor of these files probably didn't have their clang-format set up right, so these are all no-op from my resave. We should probably run format on all the files sometime, and maybe also add a format check to our CI.
| 0, | ||
| outputWidth, | ||
| outputHeight); | ||
| if ((blobCanvas as any).msToBlob) { |
There was a problem hiding this comment.
toBlob is now supported on all the major browsers, so taking the opportunity to simplify things and remove related flaky tests.
| }); | ||
|
|
||
| test('has a current time close to the delay', () => { | ||
| test.skip('has a current time close to the delay', () => { |
There was a problem hiding this comment.
An example of tests we should come back to and figure out why they're flaky (or fail on particular browsers).
| }); | ||
| test( | ||
| 'exports and re-imports the model with transformed texture', | ||
| async () => { |
There was a problem hiding this comment.
@diegoteran This implies to me that your clang-format still doesn't agree with mine - we should figure this out.
| }); | ||
|
|
||
| test('evaluates algebra with nested functions', () => { | ||
| suite('evaluates algebra with nested functions', () => { |
There was a problem hiding this comment.
This typo has been here for years; our old test runner didn't care, apparently.
| // This fails on Android when karma.conf has hostname: 'bs-local.com', | ||
| // possibly due to not serving over HTTPS (which disables WebXR)? However, | ||
| // Browserstack is unstable without this hostname. | ||
| test('supports presenting to AR only on Android', async () => { |
There was a problem hiding this comment.
We can't test this on emulated devices, but I didn't feel it was protecting us from much anyway.
| let animationControls: AnimationControls; | ||
|
|
||
| beforeEach(async () => { | ||
| setup(async () => { |
There was a problem hiding this comment.
We inherited the space-opera code base from another team that used jasmine as their test framework instead of mocha. I did a find-replace and then some more re-jiggering to get it all updated to be consistent with our other packages.
| clientX: width * position.x, | ||
| clientY: height * position.y, | ||
| clientX: width * position.x + rect.x, | ||
| clientY: height * position.y + rect.y, |
There was a problem hiding this comment.
This was an actual bug that our test didn't catch on our old CI, but did catch in this new framework, apparently because the default HTML has some padding now.
* tests run * fixed most tests * fixed more tests * update CI * update effects testing * increase timeouts * disable firefox * simpler logs * longer timeouts * skip flaky tests * more flakes * more flakes * raf * ease up test * remove karma from model-viewer * space-opera jasmine->mocha * fixed tests * cleanup * update lock * extend timeout * up space-opera timeouts * webkit fail * debug CI * try disabling renderer suite * cleanup * add devices to CI * fixed more tests * deflake * remove old work-arounds * narrow webkit failure * cleanup * revert accidental replace
Since our Karma test runner is deprecated, we're switching to modern-web, which also recommends playwright as an alternative to BrowserStack, which is free and simpler, so let's give it a shot!
Turns out this was also a good opportunity to swap
jasmineformochain thespace-operatests; it was driving me crazy that we were using two different test frameworks.