Don't mix every http request in with the tests output.
Don't print that the file servers are starting unless
-vv flag is passed.
Capture the output of run with run_output which returns
stdout, stderr and exit_code. Test against this rather
than relying on sys.exit.
* use subclass of unittest.TestCase for all test cases
* allow to run single test file (eg. python tools/integration_tests.py)
* test filtering (via --pattern/-p CLI flag)
* use common CLI parser for all tests:
usage: test.py [-h] [--failfast] [--verbose] [--executable EXECUTABLE]
[--release] [--pattern PATTERN] [--build-dir BUILD_DIR]
optional arguments:
-h, --help show this help message and exit
--failfast, -f Stop on first failure
--verbose, -v Verbose output
--executable EXECUTABLE
Use external executable of Deno
--release Test against release executable
--pattern PATTERN, -p PATTERN
Run tests that match provided pattern
--build-dir BUILD_DIR
Deno build directory
* respect NO_COLOR variable
Move every test to a method on DenoTestCase.
test.py is a single TestSuite of every TestCase.
Add a Spawn context manager for http_server,
this is explicitly used where it's needed.
Each python test file can now be run independently
without needing to manually run http_server.
Add --help and consistent flags using argparse for
each python test, including --failfast.
Use ColorTextTestRunner so that '... ok' is green.
Previously run_node.py would always attempt to remove and then re-create
the 'target/xx/node_modules' symlink. This causes sporadic build errors
on windows when multiple build targets that use run_node.py are being
built concurrently.
This is more optimial and this fixes a problem where occasionally
remove_and_symlink will error with:
gen/compiler_bundle/main.js --sourcemapFile /Users/rld/src/deno --silent
Traceback (most recent call last):
File "../../tools/run_node.py", line 18, in <module>
util.remove_and_symlink(target_rel, "node_modules", True)
File "/Users/rld/src/deno/tools/util.py", line 103, in remove_and_symlink
symlink(target, name, target_is_dir)
File "/Users/rld/src/deno/tools/util.py", line 141, in symlink
os.symlink(target, name)
OSError: [Errno 17] File exists
Checks the output more carefully. The first line of output from
js/unit_tests.ts should be something like "running 96 tests"
And the last line should be something like
"test result: ok. 96 passed; 0 failed; 0 ignored; 0 measured; 36
filtered out"
This parses those strings and make sure they align.
This will catch silent death bugs.
* Make sync_third_party work in general
* Un-break build.py and run_hooks.py on windows
* Partially fix format.py on windows
* Reduce code duplication between run_hooks and sync_third_party