Skip to content
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

Try running tests in GitHub Actions #680

Merged
merged 11 commits into from
Jan 27, 2021
Merged

Try running tests in GitHub Actions #680

merged 11 commits into from
Jan 27, 2021

Conversation

jywarren
Copy link
Member

Fixes #676

@gitpod-io
Copy link

gitpod-io bot commented Jan 26, 2021

@jywarren
Copy link
Member Author

PL undefined error from main branch! https://travis-ci.com/github/publiclab/PublicLab.Editor/jobs/399630193

@jywarren
Copy link
Member Author

It's been the case since #541, where we added --force to grunt jasmine - it didn't fail there but at some point later it did and then we stopped being able to see when jasmine failed...

@jywarren
Copy link
Member Author

Here is where it began to fail!!!! #597

@jywarren
Copy link
Member Author

I'll try pulling in each commit of woofmark from this list to see when it starts to break:

https://github.com/jywarren/woofmark/commits/plots2

whoaaaaa. i think we need to go back to jywarren/woofmark@12e2c1d...39237b7 ... yikes...

@jywarren
Copy link
Member Author

Reverting back to 12e2c1d or 3695d655c7d11fd3cee8e19f534ccc6722f1297f didn't work... :-(((

@jywarren
Copy link
Member Author

Now trying to look through every line of this commit which is when tests started to show this error: jywarren/woofmark@5cc44d6

@jywarren
Copy link
Member Author

Couldn't find anything! But, i did see that bureaucracy also changed pinned version: https://github.com/publiclab/PublicLab.Editor/pull/597/files

@jywarren
Copy link
Member Author

Seems unlikely to be the problem - the change was really minimal: bevacqua/bureaucracy@master...jywarren:xhrOptions

@jywarren
Copy link
Member Author

So whatever happened in #597, reverting it doesn't get past the PL not defined error.

My theory also that something is breaking in our dist file doesn't make sense either... it's working in Jest. Maybe it's ES6 related? But, then why would... gah... that's back to the status we had in #614.

@jywarren
Copy link
Member Author

Even that's not quite right - we should be Chrome Headless and not Phantomjs now, right? gruntjs/grunt-contrib-jasmine#252 (comment)

@jywarren
Copy link
Member Author

Ah, that only happens in grunt-contrib-jasmine v2+ -- we need to upgrade

@jywarren
Copy link
Member Author

And noting we gave up on that upgrade in #168

@jywarren
Copy link
Member Author

Haha! log: Access to XMLHttpRequest at 'file:///home/runner/work/PublicLab.Editor/PublicLab.Editor/spec/javascripts/fixtures/index.html?_=1611708375140' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, https.

I'll rework that to use a server.

@jywarren
Copy link
Member Author

Ooohhh!!!!

Error: Jasmine Ajax was unable to install over a custom XMLHttpRequest. Is Jasmine Ajax already installed? (1)
>> Error: Jasmine Ajax was unable to install over a custom XMLHttpRequest. Is Jasmine Ajax already installed? Error: Jasmine Ajax was unable to install over a custom XMLHttpRequest. Is Jasmine Ajax already installed?
>>     at MockAjax.install (file:///workspace/PublicLab.Editor/node_modules/jasmine-ajax/lib/mock-ajax.js:575:15)
>>     at UserContext.<anonymous> (file:///workspace/PublicLab.Editor/spec/javascripts/main_image_module_spec.js:50:18)
>>     at <Jasmine>
   X sends AJAX request on editor.publish()
     TypeError: Cannot read property 'blurredLocation' of undefined (1)
>> TypeError: Cannot read property 'blurredLocation' of undefined TypeError: Cannot read property 'blurredLocation' of undefined
>>     at Class.publish (file:///workspace/PublicLab.Editor/dist/PublicLab.Editor.js:21683:34)
>>     at UserContext.<anonymous> (file:///workspace/PublicLab.Editor/spec/javascripts/editor_spec.js:60:12)
>>     at <Jasmine>
   X exists, and has a textarea
     Expected undefined not to be undefined. (1)
>> Expected undefined not to be undefined. Error: Expected undefined not to be undefined.
>>     at <Jasmine>
>>     at UserContext.<anonymous> (file:///workspace/PublicLab.Editor/spec/javascripts/editor_spec.js:14:39)
>>     at <Jasmine>
     Expected <textarea class="ple-textarea form-control wk-hide">...</textarea> to be undefined. (2)
>> Expected <textarea class="ple-textarea form-control wk-hide">...</textarea> to be undefined. Error: Expected <textarea class="ple-textarea form-control wk-hide">...</textarea> to be undefined.
>>     at <Jasmine>
>>     at UserContext.<anonymous> (file:///workspace/PublicLab.Editor/spec/javascripts/editor_spec.js:17:37)
>>     at <Jasmine>

are these all ajax errors???

@jywarren
Copy link
Member Author

I tried setting 'allow-sync-xhr-in-page-dismissal'] in gruntfile because we're getting synchronous AJAX errors, but it didn't seem to work:

log: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

@jywarren jywarren mentioned this pull request Jan 27, 2021
5 tasks
@jywarren
Copy link
Member Author

Noting synch ajax was disallowed in chrome 80, should check the chrome driver version and how to flag that one

@jywarren
Copy link
Member Author

Could use StubRequest to switch jquery-ajax to synchronous: https://jasmine.github.io/2.0/ajax.html#section-12

jasmine/jasmine-ajax#26

@jywarren
Copy link
Member Author

Wow this is working! I think we should merge it. However, i do see this error sometimes: log: Failed to load resource: net::ERR_FILE_NOT_FOUND -- it could be for a vendor asset we aren't using?

Gruntfile.js Outdated
options: {
allowFileAccess: true,
sandboxArgs: {
args: ['--no-sandbox','allow-sync-xhr-in-page-dismissal'],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
args: ['--no-sandbox','allow-sync-xhr-in-page-dismissal'],
args: ['--no-sandbox', '--allow-sync-xhr-in-page-dismissal'],

@jywarren jywarren merged commit ad3d704 into main Jan 27, 2021
@jywarren
Copy link
Member Author

Yayyyyy!!!

@cesswairimu
Copy link
Collaborator

🎉🎉🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Travis taking forever to finish..move to git-actions?
2 participants