Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python3Packages.pywebview: build fix for tests
Fixes #353686 Basically the *tests/run.sh* used upstream has a few rough edges and this replaces it with a smoother version. An issue was also opened on the upstream project to maybe get this smoothed out generally. Story time for those who are curious. Basically upstream uses this as a script to call for the CI pipeline where [the builds seem to run smoothly in appveyor](https://ci.appveyor.com/project/r0x0r/pywebview/builds/50791017). However the general structure of the script iterates over the files, which in earlier versions had been done by collecting the list of tests via pytest itself, which replaced the earliest implementation which was a file hard-coding all the tests to run. The latter had the benefit of being able to disable tests by commenting them out on our end, however the new version, at least for our purpose, is just a more complicated version of running pytest against the entire thing. We can't just use plain pytest however (which'd presumably be supported by nixpkgs infra already) because we still need to shove the Qt and xvfb-run shims in between. So with running pytest as a single command we are now (with this commit) able to specifically disable tests that we know to be flakey using regular pytest means. With the Qt wrapper function passing extra args to *makeWrapper* we can use the extra flags to pass everything we need, and with the env invocation we avoid polluting the build environment so that the *checkPhase* itself doesn't change the output. Now on to the actual failing tests, apparently those happened to be related to relative paths which use an internal HTTP server to be served (for absolute paths this is optional), and getting rid of the cwd shenanigans which were required by the upstream version of the script (since it globbed on the current directory) means that somehow pytest now runs these tests without changing directory in a subprocess so the asset used for testing is properly accessible (before this change one could "fix" the tests by changing to an absolute path in the tests). Signed-off-by: benaryorg <binary@benary.org>
- Loading branch information