| Age | Commit message (Collapse) | Author | Lines |
|
Each repository is built tree for tree as before. A helper that lost
the caller's change would still fail t0107, where following no path
shows file-1, but t0108 passed without its added line, so it now looks
for that line.
|
|
The configs a run of t0101 writes are byte for byte what they were. The
scan configs name no repository and descrc adds one to a copy of the
shared config, so those keep their own form.
|
|
The library runs a script again for --tee, --verbose-log and --stress
with the arguments setup.sh left it, and --valgrind was no longer among
them, so -V --valgrind ran cgit bare. --valgrind=<tool> reached the
library instead, which then wrapped every Git command and left cgit
alone. --valgrind-only is refused, as it would need the library's own
per-test switching.
|
|
Nothing could make a missing prerequisite fail. A host without
pkg-config builds without Lua, and make test then passed with every
Lua test skipped and the lua pass of t0201 never run. The whole-script
skips become named prerequisites so the same list covers them, and the
strace probe now traces the file class of calls the tests use, so an
strace too old for it skips rather than fails.
|
|
Without -v a report went to /dev/null with the rest of stderr, and one
from a process whose status a pipeline or a background job loses
failed nothing at all.
|
|
A regression that blocked, such as a lock never let go or a filter
that never returns, hung make test rather than failing it. The alarm
is set in Perl, which the test library already wants for its chain
lint, since a pending alarm survives the exec into cgit.
|
|
It is only ever sourced, as extensions/lib.sh is.
|
|
The arguments were split back apart with globbing on, so one that
matched a file in tests/ reached the library as that file's name.
|
|
cgit_rc keeps its name, close as it is to cgitrc_repo and cgitrc_copy,
since every script calls it, so a comment now says what it runs.
|
|
Only the counts were re-pointed at results/. The --tee, --verbose-log
and --stress logs, the leak logs and the counts of a script skipped
through GIT_SKIP_TESTS still went to test-results/, which nothing
ignored or cleaned, so a summary read from one place would miss them.
|
|
An exported TEST_OUTPUT_DIRECTORY made every script bail out, and an
exported GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main failed t0102.
|
|
cgit exits 0 whatever goes wrong, and a die after the headers leaves a
page cut short behind a 200 status, so cgit_rc and its siblings pass
any page that does not crash. Only 71 of the 337 tests that request a
page checked a status line. cgit_ok also wants an empty stderr and,
for HTML, the closing tag. cgit_ok_url renders afresh with the page
cache off, since the shared config caches a page under its request
alone.
|
|
mkrepo had no && chain, so a failed add or commit went unnoticed and
every mkrepo call in the tests passed on a broken repository. The
shared fixtures were built the same way. They are still built when
setup.sh is sourced, so --run can pick out any test, but a failure now
stops the run where it broke.
|
|
The Lua probe piped cgit --version into grep, so a crash there, or a
change of wording, turned every Lua test into a skip and the run still
passed. The answer is now also held against the flags the binary was
built with in build/CGIT-CFLAGS.
|
|
The test library clears only Git's variables, so a CGI variable or
CGIT_SCINTILLUA_PATH exported in the shell reached every request, and
NO_HTTP alone strips every header. LUA_INIT runs code in each
standalone interpreter. The umask is pinned so files the tests create
get the same modes everywhere.
|
|
Only a scanned repository fell back to its description file, so one
listed in cgitrc without repo.desc showed "[no description]" however
its file read. repo.desc may follow repo.path, so the file is read
where a page shows the description, which also spares every other
request the reads.
|
|
The helpers are named by kind. cgitrc_repo and cgitrc_copy write the
config file named first, and cgit_url, cgit_query and cgit_rc run cgit,
each named after what it is handed first. A repository copies its
defaults from the globals read before its repo.url, so cgitrc_repo
places every setting itself, and a global can no longer land where it
silently stops applying. The t00xx and t01xx files move to them here.
|
|
|
|
The library has read TEST_RESULTS_SAN_DIR for the last time by the
time it returns, and the trash directory it makes is empty, so there
is no cache to remove.
|
|
setup.sh already asks the binary, so the seven scripts that each turned
the answer into a prerequisite now share one. test-lib names the missing
prerequisite beside every test it skips, so the notes that cgit lacks
Lua go, while the ones announcing a fallback stay. Every script that
listed the standalone interpreters asked for the same ceiling, so lib.sh
now builds that list for all of them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The ls_cache page printed the cache directory path and the urls other
visitors had requested, with no gate at all.
|
|
Everything the build generates now lands in build/, so a clean is a
single remove and the source tree stays free of build output.
|
|
Git 2.24.0 enabled commit-graph by default and caused crashes without
necessary update. Let's test to work with commit-graph.
Signed-off-by: Christian Hesse <mail@eworm.de>
|
|
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>
|
|
Signed-off-by: Christian Hesse <mail@eworm.de>
|
|
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>
|
|
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
|
* Rename the capitalize-* filters to dump.* since they also dump the
arguments.
* Add full argument validation to the email filters.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
|
|
* Validate the email filter by manipulating stdin. Additional checks for
all the arguments can be added in a later patch.
* Add the exec prefix to all informational messages.
* Rename the filter repository to filter-exec. The Git repository itself
is not renamed since it can be shared amongst all filter types.
* In the filter checks, check whether all arguments are passed properly
instead of validating the buffer/stdin only.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
|
|
This adds basic tests for all types of exec filters.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
|
|
Now running tests with the "--valgrind" option will run cgit under
Valgrind instead of all Git commands.
Signed-off-by: John Keeping <john@keeping.me.uk>
|
|
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>
|
|
By default, Git's test suite puts the trash directories and test-results
directory into its own directory, not that containing the tests being
run. This is less convenient for inspecting test failures, so set the
output directory to CGit's tests/ directory instead.
Note that there is currently a bug in Git whereby it will create the
trash directories in our tests/ directory regardless of the value of
TEST_OUTPUT_DIRECTORY, and then fail to remove them once the tests are
done. This change does currently affect the location of the
test-results/ directory though.
Signed-off-by: John Keeping <john@keeping.me.uk>
|
|
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>
|
|
v2: incorporate remarks of Lukas
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
|
|
v2: incorporate remarks of Lukas
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
|
|
Some tests would otherwise fail because commands such as
cd trash/repos/foo && git rev-list --reverse HEAD | head -1
would return 2 lines instead of 1: the 'cd' command also
prints the path when CDPATH is set.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
The current 'clone-prefix' setting has some known issues:
* All repos get the same 'clone-prefix' value since the setting is not
adopted during repo registration (in cgitrc, or during scan-path traversal),
but only when the setting is used.
* The generated clone-urls for a repo is a combination of 'clone-prefix', a
slash and the repo url. This doesn't work well with e.g. ssh-style urls
like 'git@example.org:repo.git', since the inserted slash will make the
repo relative to the filesystem root.
* If 'remove-suffix' is enabled, the generated clone-urls will not work for
cloning (except for http-urls to cgit itself) since they miss the '.git'
suffix.
The new 'clone-url' setting is designed to avoid the mentioned issues:
* Each repo adopts the default 'clone-url' when the repo is defined. This
allows different groups of repos to adopt different values.
* The clone-urls for a repo is generated by expanding environment variables
in a string template without inserting arbitrary characters, hence any
kind of clone-url can be generated.
* Macro expansion also eases the 'remove-suffix' pain since it's now
possible to define e.g. 'clone-url=git://foo.org/$CGIT_REPO_URL.git' for
a set of repos. A furter improvement would be to define e.g.
$CGIT_REPO_SUFFIX to '.git' for all repos which had their url prettified,
or to store the original $CGIT_REPO_URL in e.g. $CGIT_REPO_REAL_URL before
suffix removal.
Reviewed-by: Ferry Huberts <mailings@hupie.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
These tests tries to detect bad links in various pages. On the log page,
there currently exists links which are not properly escaped due to the
use of cgit_fileurl() when building the link. For now, this bug is simply
tagged as such.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
This patch makes it possible to add tests for known bugs without aborting
the testrun.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
The "((expr))" construct is not implemented by e.g. dash, so this commit
replaces the construct with a more portable one.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
The system shell (/bin/sh) on Ubuntu is dash, which aims to be a
POSIX standard shell. In particular, dash does not implement any
of the common extensions to the standard that, say, bash and ksh
do.
Replace some non-POSIX constructs in setup.sh with more portable
and mundane code.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|