1
0
mirror of https://github.com/facebook/zstd.git synced 2025-04-21 23:05:51 +03:00

14 Commits

Author SHA1 Message Date
Yann Collet
c1024af3e3
Merge pull request #3540 from dvoropaev/tests_timeout
Increase tests timeout
2023-03-31 12:25:38 -07:00
Peter Pentchev
3b001a38fe Simplify line splitting in the CLI tests 2023-03-20 11:17:43 -07:00
Peter Pentchev
29b8a3d8f2 Fix a Python bytes/int mismatch in CLI tests
In Python 3.x, a single element of a bytes array is returned as
an integer number. Thus, NEWLINE is an int variable, and attempting
to add it to the line array will fail with a type mismatch error
that may be demonstrated as follows:

    [roam@straylight ~]$ python3 -c 'b"hello" + b"\n"[0]'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    TypeError: can't concat int to bytes
    [roam@straylight ~]$
2023-03-20 11:17:43 -07:00
W. Felix Handte
50e8f55e7d Fix Python 3.6 Incompatibility in CLI Tests 2023-03-09 12:46:37 -05:00
Dmitriy Voropaev
b7080f4c67 Increase tests timeout
Current timeout is too small for some slower machines, e.g. most modern riscv64 boards,
    where tests fail with the following diagnostics:

    	Traceback (most recent call last):
    	  File "/usr/src/RPM/BUILD/zstd-1.5.4-alt2/tests/./cli-tests/run.py", line 734, in <module>
    	    success = run_tests(tests, opts)
    	  File "/usr/src/RPM/BUILD/zstd-1.5.4-alt2/tests/./cli-tests/run.py", line 601, in run_tests
    	    tests[test_case.name] = test_case.run()
    	  File "/usr/src/RPM/BUILD/zstd-1.5.4-alt2/tests/./cli-tests/run.py", line 285, in run
    	    return self.analyze()
    	  File "/usr/src/RPM/BUILD/zstd-1.5.4-alt2/tests/./cli-tests/run.py", line 275, in analyze
    	    self._join_test()
    	  File "/usr/src/RPM/BUILD/zstd-1.5.4-alt2/tests/./cli-tests/run.py", line 330, in _join_test
    	    (stdout, stderr) = self._test_process.communicate(timeout=self._opts.timeout)
    	  File "/usr/lib64/python3.10/subprocess.py", line 1154, in communicate
    	    stdout, stderr = self._communicate(input, endtime, timeout)
    	  File "/usr/lib64/python3.10/subprocess.py", line 2006, in _communicate
    	    self._check_timeout(endtime, orig_timeout, stdout, stderr)
    	  File "/usr/lib64/python3.10/subprocess.py", line 1198, in _check_timeout
    	    raise TimeoutExpired(
    	subprocess.TimeoutExpired: Command '['/usr/src/RPM/BUILD/zstd-1.5.4-alt2/tests/cli-tests/compression/window-resize.sh']' timed out after 60 seconds
2023-03-09 16:31:05 +04:00
Yann Collet
3c215220e3 modify cli-test logic : ignore stderr message by default
Previously, cli-test would, by default, check that a stderr output is strictly identical to a saved outcome.
When there was no instructions on how to interpret stderr, it would default to requiring it to be empty.

There are many tests cases though where stderr content doesn't matter, and we are mainly interested in the return code of the cli.
For these cases, it was possible to set a .ignore document, which would instruct to ignore stderr content.

This PR update the logic, to make .ignore the default.
When willing to check that stderr content is empty, one must now add an empty .strict file.

This will allow status message to evolve without triggering many cli-tests errors.
This is especially important when some of these status include compression results, which may change as a result of compression optimizations.
It also makes it easier to add new tests which only care about the CLI's return code.
2023-01-26 10:57:41 -08:00
Nick Terrell
7df6e25b85 [cli-tests] Add --set-exact-output to update the expected output
`./run.py --set-exact-output` will update `stdout.expect` and
`stderr.expect` to match the expected output. This doesn't apply to
outputs which use `.glob` or `.ignore`.
2022-12-21 17:21:09 -08:00
W. Felix Handte
8927f985ff Update Copyright Headers 'Facebook' -> 'Meta Platforms'
```
for f in $(find . \( -path ./.git -o -path ./tests/fuzz/corpora \) -prune -o -type f);
do
  sed -i 's/Facebook, Inc\./Meta Platforms, Inc. and affiliates./' $f;
done
```
2022-12-20 12:37:57 -05:00
Nick Terrell
a70ca2bd7d
Fix off-by-one error in superblock mode (#3221)
Fixes #3212.

Long literal and match lengths had an off-by-one error in ZSTD_getSequenceLength.
Fix the off-by-one error, and add a golden compression test that catches the bug.
Also run all the golden tests in the cli-tests framework.
2022-08-03 11:28:39 -07:00
Dirk Müller
7a3997c21a
Handle newer less versions in zstdless testing
Newer less versions appear to have changed how stderr
and stdout are showing error messages. hardcode the
expected behavior to make the tests pass with any less version.

Also set locale to C so that the strings are matching.
2022-03-10 09:47:33 +01:00
binhdvo
936ae8a3a0
Move zstdgrep and zstdless tests to cli-tests (#3057)
* Move zstdgrep and zstdless tests to cli-tests

Co-authored-by: Binh Vo <binhvo@fb.com>
2022-02-09 11:21:33 -05:00
Nick Terrell
169f8c11ff [cli-tests] Fix zstd symlinks
The zstd symlinks, notably `zstdcat`, weren't working as expected
because only the `tests/cli-tests/bin/zstd` wrapper was symlinked. We
still invoked `zstd` with the name `zstd`. The fix is to create a
directory of zstd symlinks in `tests/cli-tests/bin/symlinks` for each
name that zstd recognizes. And when `tets/cli-tests/bin/zstd` is
invoked, it selects the correct symlink to call.

See the test `zstd-cli/zstdcat.sh` for an example of how it would work.
2022-02-07 15:20:42 -08:00
Yonatan Komornik
4bba97b4cb
Macos playtest envvars fix (#3035)
* playtests.sh: fix for a bug in macos' /bin/sh that persists temporary env vars when introduced before function calls
* cli-tests/run.py: Do not use existing ZSTD* envvars
2022-02-03 18:42:20 -08:00
Nick Terrell
f3096ff6d1 [test] Add new CLI testing platform
Adds the new CLI testing platform that I'm proposing.
See the added `README.md` for details.
2022-01-27 13:56:59 -08:00