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

Test suite does not run WebDriver tests on Windows #289

Closed
rmorshea opened this issue Jan 31, 2021 · 13 comments · Fixed by #820
Closed

Test suite does not run WebDriver tests on Windows #289

rmorshea opened this issue Jan 31, 2021 · 13 comments · Fixed by #820
Labels
priority-2-moderate Should be resolved on a reasonable timeline. type-bug About something that isn't working
Milestone

Comments

@rmorshea
Copy link
Collaborator

rmorshea commented Jan 31, 2021

Summary

At the moment WebDriver tests are not run on Windows because they are failing for some unknown reason.

How To Work On This Bug

At the moment WebDriver tests are being skipped. To unskip them when you run the test suite comment out these lines:

https://github.com/idom-team/idom/blob/2804ae2620d4a2b719684460fd56b97deb65b4ba/tests/conftest.py#L151-L161

Current Findings

I don't have a Windows machine myself so it's quite difficult to try and debug. Further the tracebacks and logs that are produced don't really help much in figuring out what the problem is. The only thing I've been able to identify is that not all the files are being loaded from the server when loading up the index.html page.

On Linux (expected behavior):

[2021-01-29 16:40:55 -0800] - (sanic.access)[INFO][127.0.0.1:56132]: GET http://localhost:5000/  302 0
[2021-01-29 16:40:55 -0800] - (sanic.access)[INFO][127.0.0.1:56132]: GET http://localhost:5000/client/index.html  200 387
[2021-01-29 16:40:55 -0800] - (sanic.access)[INFO][127.0.0.1:56132]: GET http://localhost:5000/client/index.js  200 982
[2021-01-29 16:40:55 -0800] - (sanic.access)[INFO][127.0.0.1:56132]: GET http://localhost:5000/client/web_modules/idom-client-react.js  200 39291
[2021-01-29 16:40:55 -0800] - (sanic.access)[INFO][127.0.0.1:56132]: GET http://localhost:5000/client/web_modules/htm.js  200 1220
[2021-01-29 16:40:55 -0800] - (sanic.access)[INFO][127.0.0.1:56136]: GET http://localhost:5000/client/web_modules/common/index-6ed86a98.js  200 9836

On Windows (missing GET requests):

[2021-01-30 00:32:17 -0000] - (sanic.access)[INFO][127.0.0.1:50486]: GET http://127.0.0.1:50482/  302 0
[2021-01-30 00:32:17 -0000] - (sanic.access)[INFO][127.0.0.1:50486]: GET http://127.0.0.1:50482/client/index.html  200 403
[2021-01-30 00:32:17 -0000] - (sanic.access)[INFO][127.0.0.1:50486]: GET http://127.0.0.1:50482/client/index.js  200 1016

This is odd because index.js should import idom-client-react.js which itself imports other JS files, however the expected requests are missing when running the test suite in CI.

Get Support

I'm happy to help debug this issue with anyone who's interested in investigating.

@rmorshea rmorshea added the type-bug About something that isn't working label Jan 31, 2021
@rmorshea rmorshea self-assigned this Jan 31, 2021
@rmorshea rmorshea added priority-2-moderate Should be resolved on a reasonable timeline. and removed help wanted labels Jan 11, 2022
@rmorshea rmorshea added this to the 2.0 milestone Jan 13, 2022
@rmorshea
Copy link
Collaborator Author

@acivitillo I noticed that you're working with IDOM on Windows. Is there any chance you might be able to help out with this issue?

@acivitillo
Copy link
Contributor

I will take a look to the tests. I am not too familiar with the internals of idom so this might take a while and I might have a few questions for you.

On Windows, I was able to make idom work by doing pip install idom==0.34.0. I get the below files when visiting an idom page, so far the app is pulling the right files.

image

@rmorshea
Copy link
Collaborator Author

Actually, now that I think about it, this issue is pretty old. It would be good for me to try and reproduce it now and update any logs before you give this a go.

@Archmonger
Copy link
Contributor

Archmonger commented Jan 17, 2022

On upstream/main@b036f03 (latest to date)

nox -s test -- --headless

  • Docker build failure: snowpack could not load fast-json-patch.
  • Test Docs failure: Unknown error. No error codes or console output.
  • Test Python Suite failure: Codecov did not reach 100% coverage
  • Test JavaScript warning: NPM Audit 5 vulnerabilities (4 moderate, 1 high)
  • Test JavaScript Style failure: Prettier detected formatting is required within client\packages\idom-app-react
nox > * test: success
nox > * test_python: success
nox > * test_docs: failed
nox > * test_javascript: success
nox > * test_python_suite: failed
nox > * test_python_types: success
nox > * test_python_style: success
nox > * test_python_build: success
nox > * test_javascript_suite: success
nox > * test_javascript_build: success
nox > * test_javascript_style: failed

@rmorshea
Copy link
Collaborator Author

There's probably more problems that are currently being hidden. In order to get the suite to pass on Windows in CI, I've been skipping all tests that require the browser (hence the missing coverage).

@Archmonger
Copy link
Contributor

I'll edit out the conditional and see what else breaks. Will report back in a few minutes.

@Archmonger
Copy link
Contributor

Yep, everything webdriver related is broken. Probably because Selenium on Windows is broken in general.

@rmorshea
Copy link
Collaborator Author

rmorshea commented Jan 17, 2022

I've been wanting to switch to an async web driver. If one of the available options uses a different web driver solution, that might solve these issues too.

@acivitillo
Copy link
Contributor

I know we want to make Windows working directly with idom, but given the fact idom probably needs to be deployed as a container anyway, could we maybe fix this with a tutorial "how to setup your dev environment with idom and docker".

@Archmonger
Copy link
Contributor

Archmonger commented Jan 17, 2022

IDOM works perfectly on Windows. I've been using it for a couple months now with no Windows specific bugs. Notably, I've been doing my development on bare-metal with no containers.

It's just the IDOM tests that are broken, due to reliance on the selenium webserver.

@rmorshea
Copy link
Collaborator Author

rmorshea commented Jan 17, 2022

Ultimately we should try and get this working on Windows, but for now that's a great option. I can write up an issue to capture that tomorrow or you should feel free to use the "Plan a Task" issue template.

@acivitillo
Copy link
Contributor

I confirm idom works great on my Windows too.

@rmorshea
Copy link
Collaborator Author

Yeah, I think the main thing I want to fix here is the contributor experience. I've been developing this on my own for the most part, but at some point I'm gonna need help, so making sure its easy to make contributions is going to be important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-2-moderate Should be resolved on a reasonable timeline. type-bug About something that isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants