Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d30f74d
Changing shell command to add recognizing a TTY for stty tests
ChrisDryden Nov 19, 2025
90dec7d
Added additional comment explaining use of script
ChrisDryden Nov 24, 2025
ecf62f6
Explain the main purpose is to run the GNU stty tests
ChrisDryden Nov 24, 2025
24254b7
Fixing spelling mistake
ChrisDryden Nov 24, 2025
06fb853
Reverting CI.yml file
ChrisDryden Nov 24, 2025
4e8cc1e
Adding pty helper inside gnu test script
ChrisDryden Nov 24, 2025
9780d38
Update run-gnu-test.sh
ChrisDryden Nov 24, 2025
8724d33
Skip running on SELinux or other environments without script command
ChrisDryden Nov 24, 2025
df10360
Update run-gnu-test.sh
ChrisDryden Nov 24, 2025
e569e78
Update run-gnu-test.sh
ChrisDryden Nov 24, 2025
8912edd
Update run-gnu-test.sh
ChrisDryden Nov 24, 2025
906923a
Update GnuTests.yml
ChrisDryden Nov 24, 2025
4271af9
Update run-gnu-test.sh
ChrisDryden Nov 24, 2025
08ea89b
Update GnuTests.yml
ChrisDryden Nov 24, 2025
c10b1d0
Update GnuTests.yml
ChrisDryden Nov 24, 2025
b831fd2
Update GnuTests.yml
ChrisDryden Nov 28, 2025
f6439b2
Update GnuTests.yml
ChrisDryden Nov 29, 2025
e9357bc
Update GnuTests.yml
ChrisDryden Nov 29, 2025
a7c8984
Making the list of the tests to be run created dynamically and added …
ChrisDryden Dec 7, 2025
d8eccd3
Making the list of the tests to be run created dynamically and added …
ChrisDryden Dec 7, 2025
558a044
Splitting the running of the stty tests so that the mv test does not …
ChrisDryden Dec 7, 2025
f7f8a94
Fixing spelling mistake
ChrisDryden Dec 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion .github/workflows/GnuTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
TEST_FULL_SUMMARY_FILE: 'gnu-full-result.json'
TEST_ROOT_FULL_SUMMARY_FILE: 'gnu-root-full-result.json'
TEST_STTY_FULL_SUMMARY_FILE: 'gnu-stty-full-result.json'
TEST_SELINUX_FULL_SUMMARY_FILE: 'selinux-gnu-full-result.json'
TEST_SELINUX_ROOT_FULL_SUMMARY_FILE: 'selinux-root-gnu-full-result.json'

Expand Down Expand Up @@ -137,12 +138,34 @@ jobs:
path_GNU='gnu'
path_UUTILS='uutils'
bash "uutils/util/run-gnu-test.sh" run-root

- name: Extract testing info from individual logs (run as root) into JSON
shell: bash
run : |
path_UUTILS='uutils'
python uutils/util/gnu-json-result.py gnu/tests > ${{ env.TEST_ROOT_FULL_SUMMARY_FILE }}

### This shell has been changed from "bash" to this command
### "script" will start a pty and the -q command removes the "script" initiation log
### the -e flag makes it propagate the error code and -c runs the command in a pty
### the primary purpose of this change is to run the tty GNU tests
### The reason its separated from the rest of the tests is because one test can corrupt the other
### tests through the use of the shared terminal and it changes the environment that the other
### tests are run in, which can cause different results.
- name: Run GNU stty tests
shell: 'script -q -e -c "bash {0}"'
run: |
## Run GNU root tests
path_GNU='gnu'
path_UUTILS='uutils'
bash "uutils/util/run-gnu-test.sh" run-tty

- name: Extract testing info from individual logs (stty) into JSON
shell: bash
run : |
path_UUTILS='uutils'
python uutils/util/gnu-json-result.py gnu/tests > ${{ env.TEST_STTY_FULL_SUMMARY_FILE }}

### Upload artifacts
- name: Upload full json results
uses: actions/upload-artifact@v5
Expand All @@ -154,6 +177,12 @@ jobs:
with:
name: gnu-root-full-result
path: ${{ env.TEST_ROOT_FULL_SUMMARY_FILE }}
- name: Upload stty json results
uses: actions/upload-artifact@v5
with:
name: gnu-stty-full-result
path: ${{ env.TEST_STTY_FULL_SUMMARY_FILE }}

- name: Compress test logs
shell: bash
run : |
Expand Down Expand Up @@ -358,6 +387,13 @@ jobs:
name: gnu-root-full-result
path: results
merge-multiple: true
- name: Download stty json results
uses: actions/download-artifact@v6
with:
name: gnu-stty-full-result
path: results
merge-multiple: true

- name: Download selinux json results
uses: actions/download-artifact@v6
with:
Expand All @@ -380,7 +416,7 @@ jobs:
path_UUTILS='uutils'

json_count=$(ls -l results/*.json | wc -l)
if [[ "$json_count" -ne 4 ]]; then
if [[ "$json_count" -ne 5 ]]; then
echo "::error ::Failed to download all results json files (expected 4 files, found $json_count); failing early"
ls -lR results || true
exit 1
Expand Down
17 changes: 14 additions & 3 deletions util/run-gnu-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ if test $# -ge 1; then
done
fi

if [[ "$1" == "run-root" && "$has_selinux_tests" == true ]]; then
if [[ "$1" == "run-tty" ]]; then
# Handle TTY tests - dynamically find tests requiring TTY and run each individually
shift
TTY_TESTS=$(grep -r "require_controlling_input_terminal" tests --include="*.sh" --include="*.pl" -l 2>/dev/null)
echo "Running TTY tests individually:"
# If a test fails, it can break the implementation of the other tty tests. By running them separately this stops the different tests from being able to break each other
for test in $TTY_TESTS; do
echo " Running: $test"
script -qec "timeout -sKILL 5m '${MAKE}' check TESTS='$test' SUBDIRS=. RUN_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit='' srcdir='${path_GNU}'" /dev/null || :
done
exit 0
elif [[ "$1" == "run-root" && "$has_selinux_tests" == true ]]; then
# Handle SELinux root tests separately
shift
if test -n "$CI"; then
Expand All @@ -63,7 +74,7 @@ if [[ "$1" == "run-root" && "$has_selinux_tests" == true ]]; then
sudo "${MAKE}" -j "$("${NPROC}")" check TESTS="$*" SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit="" srcdir="${path_GNU}" TEST_SUITE_LOG="tests/test-suite-root.log" || :
fi
exit 0
elif test "$1" != "run-root"; then
elif test "$1" != "run-root" && test "$1" != "run-tty"; then
if test $# -ge 1; then
# if set, run only the tests passed
SPECIFIC_TESTS=""
Expand Down Expand Up @@ -91,7 +102,7 @@ fi
# * `srcdir=..` specifies the GNU source directory for tests (fixing failing/confused 'tests/factor/tNN.sh' tests and causing no harm to other tests)
#shellcheck disable=SC2086

if test "$1" != "run-root"; then
if test "$1" != "run-root" && test "$1" != "run-tty"; then
# run the regular tests
if test $# -ge 1; then
timeout -sKILL 4h "${MAKE}" -j "$("${NPROC}")" check TESTS="$SPECIFIC_TESTS" SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit="" srcdir="${path_GNU}" || : # Kill after 4 hours in case something gets stuck in make
Expand Down
Loading