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
SoundsTest passes in ChromeHeadless #32518
Conversation
|
||
describe('Sounds', () => { | ||
const sounds = new Sounds(); | ||
const sourceURL = | ||
'studio.code.org/api/v1/sound-library/KyZOBksdJiQSlvoiOzFGpryJiMexdfks/category_ui/click1.mp3'; |
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.
This URL 404s, and where PhantomJS left its sound in a "still loading" state so that the test would pass, ChromeHeadless resolves the 404 right away and leaves the sound in a "load failed" state.
@@ -1,11 +1,11 @@ | |||
import {expect} from '../util/deprecatedChai'; | |||
import Sounds from '@cdo/apps/Sounds'; | |||
import sinon from 'sinon'; | |||
import winMp3 from '!!file-loader!../audio/assets/win.mp3'; |
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've fixed this by using Webpack's file-loader inline (which is nice because we don't really need this as part of our global config) to pull an existing fixture mp3 file from our repo, which is guaranteed to load unlike the broken URL below.
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.
Thanks for doing this!
I've been trying to run tests in ChromeHeadless on my local machine, since PhantomJS isn't working properly on recent versions of Ubuntu. Eventually, I'd like us to use ChromeHeadless in our CI builds too, but to do that, we need to fix up all the tests that fail on this browser.
One of the tests that fails is
SoundsTest#does play URLs when unmuted
. I believe this fixes that test under both ChromeHeadless and PhantomJS.Reviewer Checklist: