HomePhabricator

qa: Make extended tests pass on native Windows

Description

qa: Make extended tests pass on native Windows

Summary:

qa: Close stdout and stderr file when node stops

Since these files are potentially deleted by the test framework for
cleanup, they should be closed first. Otherwise this will lead to errors
on Windows when the tests finish successfully.

Side note: After the patch, it is no longer possible to reopen the file
on Windows (see
https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile)
qa: Run gen_rpcauth with sys.executable

Similar to test_runner.py, the sys.executable needs to be passed down
into subprocesses to pass on native Windows. (Should have no effect on
Linux)
qa: Use files for stdout/stderr to support Windows

It seems that using PIPE is not supported on Windows. Also, it is easier
to just use the files that capture the stdout and stderr within the test
node class.

Backport of core PR13867.

Test Plan:

ninja check-functional

*The following needs D5959.*
Build for windows, then:

  • Install python if needed and add it to your path
  • If you copy the project to some place, you need at least the src,

test, share and your build directories.

  • Copy the test_runner.py to the build directory to replace the symlink
  • Update the config.ini file to match you paths

Then in a powershell:

$env:PYTHONIOENCODING="utf-8"
python .\test\functional\test_runner.py --force feature_help
python .\test\functional\test_runner.py --force rpc_users

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5960

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Aug 3 2018, 17:43
FabienCommitted on May 5 2020, 14:25
FabienPushed on May 5 2020, 14:32
Reviewer
Restricted Project
Differential Revision
D5960: qa: Make extended tests pass on native Windows
Parents
rSTAGINGfda14e4160c1: qa: Fix some tests to work on native windows
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/19441, tag: phabricator/base/19439