-
Notifications
You must be signed in to change notification settings - Fork 70
Refactor compat test scripts and add Docker support for local testing #643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kevinburkesegment
wants to merge
2
commits into
uutils:main
Choose a base branch
from
kevinburkesegment:refactor-compat-scripts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+186
−153
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| FROM ubuntu:24.04 | ||
|
|
||
| RUN apt-get update \ | ||
| && sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources \ | ||
| && apt-get update \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| git curl wget ca-certificates build-essential jq \ | ||
| autoconf automake autopoint texinfo dejagnu libcap2-bin \ | ||
| && apt-get build-dep -y findutils \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Install Rust | ||
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
| ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
|
||
| # Clone and pre-build GNU findutils (matches CI ref) | ||
| RUN git clone https://github.com/gnu-mirror-unofficial/findutils.git /findutils.gnu \ | ||
| && cd /findutils.gnu \ | ||
| && git checkout 5768a03ddfb5e18b1682e339d6cdd24ff721c510 \ | ||
| && git submodule sync --recursive \ | ||
| && git config submodule.gnulib.url https://github.com/coreutils/gnulib.git \ | ||
| && git submodule update --init --recursive --depth 1 \ | ||
| && ./bootstrap \ | ||
| && ./configure --quiet \ | ||
| && make -j "$(nproc)" | ||
|
|
||
| # Clone and pre-build BFS test utilities (matches CI ref) | ||
| RUN git clone --branch 4.0 https://github.com/tavianator/bfs.git /bfs \ | ||
| && cd /bfs \ | ||
| && ./configure NOLIBS=y \ | ||
| && make -j "$(nproc)" bin/tests/mksock bin/tests/xtouch | ||
|
|
||
| # Build Rust artifacts to /target so we don't clobber the host's target/ | ||
| ENV CARGO_TARGET_DIR=/target | ||
|
|
||
| WORKDIR /findutils |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/bin/bash | ||
| # Common utilities for findutils compatibility test scripts. | ||
|
|
||
| COMMON_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| FINDUTILS_DIR="$(cd "$COMMON_DIR/.." && pwd)" | ||
| CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$FINDUTILS_DIR/target}" | ||
|
|
||
| FIND_BIN="$CARGO_TARGET_DIR/release/find" | ||
| XARGS_BIN="$CARGO_TARGET_DIR/release/xargs" | ||
|
|
||
| build_rust() { | ||
| echo "Building Rust findutils..." | ||
| (cd "$FINDUTILS_DIR" && cargo build --release) | ||
| } | ||
|
|
||
| check_total() { | ||
| local total="$1" | ||
| if (( total <= 1 )); then | ||
| echo "Error in the execution, failing early" | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| print_summary() { | ||
| local label="$1" total="$2" pass="$3" skip="$4" fail="$5" error="${6:-0}" | ||
| local output="$label summary = TOTAL: $total / PASS: $pass / SKIP: $skip / FAIL: $fail / ERROR: $error" | ||
| echo "$output" | ||
| if (( fail > 0 || error > 0 )); then | ||
| echo "::warning ::$output" | ||
| fi | ||
| } | ||
|
|
||
| generate_result_json() { | ||
| local output_file="$1" total="$2" pass="$3" skip="$4" fail="$5" | ||
| local xpass="${6:-0}" error="${7:-0}" | ||
| jq -n \ | ||
| --arg date "$(date --rfc-email 2>/dev/null || date '+%a, %d %b %Y %T %z')" \ | ||
| --arg sha "${GITHUB_SHA:-$(git -C "$FINDUTILS_DIR" rev-parse HEAD 2>/dev/null || echo unknown)}" \ | ||
| --arg total "$total" \ | ||
| --arg pass "$pass" \ | ||
| --arg skip "$skip" \ | ||
| --arg fail "$fail" \ | ||
| --arg xpass "$xpass" \ | ||
| --arg error "$error" \ | ||
| '{($date): { sha: $sha, total: $total, pass: $pass, skip: $skip, fail: $fail, xpass: $xpass, error: $error, }}' > "$output_file" | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: The previous download-and-compare steps downloaded artifacts from
the current run (${{ github.run_id }}), then compared them against
the same logs already on disk -- producing "PASS +0 / FAIL +0" every
time (confirmed in upstream CI logs). To do actual regression detection,
this would need to download artifacts from the main branch's latest
run (e.g. via dawidd6/action-download-artifact). The artifact uploads
above are preserved for the upload-annotations job.