AgeCommit message (Collapse)AuthorLines
Let a test run require the tools it must not skipBryce Kwon-23/+39
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.
Fail a test script that leaves a sanitizer reportBryce Kwon-0/+42
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.
Put a time limit on each request in the testsBryce Kwon-1/+4
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.
Stop marking setup.sh as executableBryce Kwon-0/+0
It is only ever sourced, as extensions/lib.sh is.
Leave no stray variables or globs from setup.shBryce Kwon-4/+9
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.
Correct the comments on the test plumbingBryce Kwon-3/+10
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.
Clean a trash directory a stopped test lockedBryce Kwon-0/+3
A script stopped by -i or --debug inside one of the SANITY tests leaves a directory without permissions, and make clean then failed on it.
Run every test script and sum up the resultsBryce Kwon-5/+79
make stopped at the first failing script and left every later one unrun. Each script's closing line also counts its skipped tests as passes, so a run that skipped half the suite read like a full one, and the counts the library writes for each script were never read.
Keep the test results where the library puts themBryce Kwon-8/+1
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.
Pin what the test library reads from the shellBryce Kwon-2/+9
An exported TEST_OUTPUT_DIRECTORY made every script bail out, and an exported GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main failed t0102.
Add a request helper that checks the answerBryce Kwon-0/+47
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.
Fail where a test fixture breaksBryce Kwon-24/+29
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.
Stop the run when cgit cannot report its buildBryce Kwon-4/+23
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.
Keep the developer's environment out of the testsBryce Kwon-0/+15
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.
Fetch avatar icons without a RefererBryce Kwon-0/+1
The icons came from Gravatar or Libravatar with the page's url as the Referer, so the service learned which repositories and commits each visitor looked at.
Cut the nginx config down to a generic drop-inBryce Kwon-16/+2
The old file was a complete nginx.conf with TLS, compression, catch-all hosts and security headers, and it had to be taken apart before it ran beside a distribution's own nginx.conf. A server block included from the http block leaves the user, the MIME types and the logs to the distribution. Its header gives one default path per thing, adjusted where a system differs, which leaves packagers a plain base to adapt rather than a table for each distribution. HTTPS and git-http-backend are commented examples, so the file serves plain HTTP as shipped. The backend takes only the three smart HTTP paths at cgit's own repository urls, so every page still reaches cgit. git refuses a repository another user owns, which failed every clone until safe.directory was set for the backend, and a 3 MB push got 413 until the location lifted nginx's body limit. The split empties SCRIPT_NAME because a second SCRIPT_NAME after the include reaches fcgiwrap as well, and cgit reads the first one, which put every link under the request path. cgit sends nosniff and a locked policy on raw output itself, so the configs no longer carry one. The t0004 check that all three agree goes here, with the first of them to drop it.
Let a keyboard scroll the stats tableBryce Kwon-0/+6
It scrolls sideways like the hex dump, with nothing inside a keyboard can reach, so it takes focus and the shared focus ring the same way.
Name a pinned commit with the page in the titleBryce Kwon-0/+13
Let a keyboard scroll the hex dumpBryce Kwon-1/+10
Chrome and Firefox already let an overflowing box take focus, with their own ring, but WebKit does not. The table takes focus on a mouse click as well, where focus-visible keeps the ring off.
Read the file and diff tables as layoutBryce Kwon-0/+12
The file view's table only sets the line numbers beside the code, and the unified diff's is a single cell holding every file.
Read the login form table as layoutBryce Kwon-0/+1
Say which index column is sortedBryce Kwon-0/+13
Put a Lua filter's print output where it runsBryce Kwon-0/+20
LuaJIT and Lua 5.1 leave print's line in stdio's buffer until cgit exits, after the end of the page.
Report a snapshot format name that matches nothingBryce Kwon-0/+19
Answer an empty repository's feed with a feedBryce Kwon-0/+19
Keep a repository's own settings in a cached scanBryce Kwon-0/+47
A scanned repository is read back from the cached list under the global settings, so a setting that only differed from them by being off, or by naming the default value, came back as the global one. branch-sort was written only for age, per-path module links not at all, and a filter a repository turned off left no line behind. Writing an empty value for a filter turned off makes the list depend on whether each global filter is set, so the scan key names that too.
Keep the placeholder out of a cached scanBryce Kwon-0/+12
The cached list wrote "[no description]" like any other description, so once read back it no longer counted as the placeholder and became the meta description of every repository without one. Repositories read back from the list are also marked as having had their description file read, since the scan already did, so the index does not open those files again on every request.
Leave the scan uncached with a negative cache-sizeBryce Kwon-0/+15
The page cache counts a cache-size of 0 or less as off, but scan-path cached its list for any value other than 0, so a negative one still wrote a list into cache-root.
Name a missing Lua module in the error logBryce Kwon-5/+25
Log failed loginsBryce Kwon-0/+7
The login posts outside any repository, so the log line names the repository by the page its signed way back leads to.
Say that logging in needs httpsBryce Kwon-1/+12
Only HTTPS=on counts, the same test cgit makes before it writes an https link of its own.
Tell a signed-in visitor they have no accessBryce Kwon-0/+7
Say when logins are unavailableBryce Kwon-3/+40
The way back was signed part way through the form, so while the secret's directory did not exist, or a library was missing, cgit's error landed inside the hidden input and the page broke off there with no fields.
Keep counting across a split ordered listBryce Kwon-0/+7
Keep the login page out of search indexesBryce Kwon-0/+14
Keep a protected repository's header to itselfBryce Kwon-0/+28
The login page stands in for any page of the repository, so it named the description and owner of one the visitor may not see, including one hidden from the index. The site's own description fills the line, as on the index, so the header keeps its height.
Name the logo after the siteBryce Kwon-0/+7
Head the tag table's column for what it holdsBryce Kwon-0/+13
Say when a log search matches nothingBryce Kwon-0/+10
Answer a submodule path with the submoduleBryce Kwon-0/+9
The tree page read the gitlink's commit as a blob, which outside the repository is a bad object id and inside it is the commit's raw text.
Say when nothing matches a mistyped urlBryce Kwon-0/+11
Lead an error page's title with the errorBryce Kwon-0/+13
The config error page had a title of its own, in the reverse order, and now takes the same one as any other 404, since its message already says the repository failed to open.
Keep the range in a large diff's patch linkBryce Kwon-0/+11
The link named only id, so for a diff between two commits it led to a patch of the newer one alone, and without an id it lost the branch as well and led to the default branch's tip.
Offer blame only where it worksBryce Kwon-0/+29
The blame page answers 404 for a symlink, since git blames a regular file alone, and it refuses a binary file and one past max-blob-size, yet a tree listing offered blame for all of them, and so did a symlink's own page. Each row already knows its size, and git calls a file binary by its first 8000 bytes alone, which a stream reads without inflating the rest. With blame on, a listing of 2,000 delta-packed files went from about 11 to 15 ms.
Dump only the first 64 KB of a binary fileBryce Kwon-1/+18
Blame the previous revision under its own nameBryce Kwon-0/+21
Lead a blame page's folder crumbs to the treeBryce Kwon-0/+16
Link snapshots of a slash ref by a dashed nameBryce Kwon-0/+19
The snapshot page refuses to work a revision out of a name holding a slash, since that name becomes the top directory of the archive, so every link for a ref like release/2.0 answered 404. The ref now goes in the link as the id, and the archive unpacks into the repository's own prefix, as any snapshot asked for by id does.
Show a renamed file's diff as the renameBryce Kwon-0/+75
A diff limited to the new name cannot see the old one, so the diffstat's link for a renamed file, the commit page reached from that file's log, and the file's rawdiff and patch all showed every line as added. A path the old tree lacks is now diffed across the whole commit with rename detection aimed at it alone, the way git blame looks for a rename, so it is compared with the commit's deleted files and nothing else. Doing it in cgit_diff_tree keeps the log's counts for that commit in step with the page they link to. The rawdiff and patch pages leave the diff to git's own output, so for them that search finds the old name, and both names go into the limit with rename detection on.
Log the path of a repository that will not openBryce Kwon-0/+14
The 404 page names only the repository and nothing reached the log, so a mistyped repo.path left no trace of the path cgit had tried.