Commit Graph

17 Commits (master)

Author SHA1 Message Date
Todd Zullinger bd6f5683f6 tests: t0107: support older and/or non-GNU tar
The untar tests for various compression algorithms use shortcut options
from GNU tar to handle decompression.  These options may not be provided
by non-GNU tar nor even by slightly older GNU tar versions which ship on
many systems.

An example of the latter case is the --zstd option.  This was added in
GNU tar-1.32 (2019-02-23)¹.  This version of tar is not provided by
CentOS/RHEL, in particular.  In Debian, --zstd has been backported to
the tar-1.30 release.

Avoid the requirement on any specific implementations or versions of tar
by piping decompressed output to tar.  This is compatible with older GNU
tar releases as well as tar implementations from other vendors.  (It may
also be a slight benefit that this more closely matches what the
snapshot creation code does.)

¹ Technically, the --zstd option was first released in tar-1.31
  (2019-01-02), but this release was very short-lived and is no longer
  listed on the GNU Tar release page.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
3 years ago
Christian Hesse a1039ab175 tests: do not copy snapshots to /tmp/
No idea why this was added... Possibly to inspect the snapshot manually?
Let's drop it.

Signed-off-by: Christian Hesse <mail@eworm.de>
4 years ago
Christian Hesse 892ba8c3cc ui-snapshot: add support for zstd compression
This patch adds support for zstd [0] compressed snapshots (*.tar.zst).
We enable multiple working threads (-T0), but keep default compression
level. The latter can be influenced by environment variable.

[0] https://www.zstd.net/

Signed-off-by: Christian Hesse <mail@eworm.de>
4 years ago
Christian Hesse cc230bf044 tests: add tests for xz compressed snapshots
Signed-off-by: Christian Hesse <mail@eworm.de>
4 years ago
Hanspeter Portner 06671f4b21 ui-snapshot: add support for lzip compression
This patch adds support for lzip [1] compressed snapshots (*.tar.lz)

[1] https://www.nongnu.org/lzip/

Signed-off-by: Hanspeter Portner <dev@open-music-kontrollers.ch>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years ago
John Keeping 75bfec6448 tests: introduce strip_header() helper function
This means that we can avoid hardcoding the number of headers we expect
CGit to generate in test cases and simply remove whatever headers happen
to by there when we are checking body content.

Signed-off-by: John Keeping <john@keeping.me.uk>
11 years ago
Lukas Fleischer 81bf4d32b3 t0107: Skip ZIP tests if unzip(1) isn't available
Note that we cannot use skip_all here since some tests have already been
executed when ZIP tests are reached. Use test prerequisites to skip
everything using unzip(1) if the binary is not available instead.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
11 years ago
Lukas Fleischer 410da3ac1c t0107: Use `tar -z` for gzip'ed archives
Some tar(1) versions do not support auto detection of the compression
type. Explicitly specify "-z" to decompress a ".tar.gz" archive.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
11 years ago
John Keeping c95cc5ec56 tests: use Git's test framework
This allows tests to run in parallel as well as letting us use "prove"
or another TAP harness to run the tests.

Git's test framework requires Git to be fully built before letting any
tests run, so add a new target to the top-level Makefile which builds
all of Git instead of just libgit.a and make the "test" target depend on
that.

Signed-off-by: John Keeping <john@keeping.me.uk>
11 years ago
John Keeping d5a43b429a t0107-snapshot: add tests for ZIP archives
Signed-off-by: John Keeping <john@keeping.me.uk>
11 years ago
John Keeping f9b801a174 tests: make whitespace consistent
Signed-off-by: John Keeping <john@keeping.me.uk>
11 years ago
John Keeping 392e07d28a tests: "grep -e" is not portable to all platforms
The "-e" option to grep is not needed unless specifying more than one
pattern, which we don't do.  Remove it to avoid restricting the tests on
platforms that do not have a grep that recognises "-e".

Signed-off-by: John Keeping <john@keeping.me.uk>
11 years ago
Lars Hjemli aa60ae12cb Merge branch 'snapshot-fixes' 16 years ago
Lars Hjemli 7bbc274585 tests/t0107-snapshot.sh: make testscript match updated snapshot behavior
Since cgit now returns a 404 error when the snapshot filename cannot be
resolved to a commit object, the testscript needs to request a valid
snapshot name.

Also, the script assumed that the toplevel directory in the snapshot
would get the name of the repository but it's now named similar to
the requested snapshot.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli ed77b2e0bf ui-snapshot.c: change mime-type for tar.gz and tar.bz2
The updated mime-types seems to work better than the old ones with both
safari and firefox.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli 204669ff4a ui-snapshot.c: specify archiver_args.baselen
The struct member was introduces in git commit d53fe8187c38, but the cgit
testsuite failed to detect that cgit always generated archives without
prefixes, i.e. the result from cgit_repobasename was ignored.

This fixes the bug and the testsuite.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli b4649fc905 Create initial testsuite
This creates a simple testsuite, heavily inspired by the testsuite in git.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago