Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,23 @@ jobs:

- name: Check
run: npx --yes @taplo/cli fmt --check

python:
name: Style/Python
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: ruff
uses: astral-sh/ruff-action@v3
with:
src: "./util"

- name: ruff - format
uses: astral-sh/ruff-action@v3
with:
src: "./util"
args: format --check
1 change: 1 addition & 0 deletions util/analyze-gnu-results.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
Prints shell export statements for TOTAL, PASS, FAIL, SKIP, XPASS, and ERROR
that can be evaluated in a shell environment.
"""

import json
import sys
from collections import defaultdict
Expand Down
12 changes: 7 additions & 5 deletions util/compare_gnu_result.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python3

"""
Compare the current results to the last results gathered from the main branch to highlight
if a PR is making the results better/worse.
Compare the current results to the last results gathered from the main branch to
highlight if a PR is making the results better/worse.
Don't exit with error code if all failing tests are in the ignore-intermittent.txt list.
"""

Expand All @@ -28,17 +28,19 @@

# Get an annotation to highlight changes
print(
f"::warning ::Changes from '{REPO_DEFAULT_BRANCH}': PASS {pass_d:+d} / FAIL {fail_d:+d} / ERROR {error_d:+d} / SKIP {skip_d:+d} "
f"""::warning ::Changes from '{REPO_DEFAULT_BRANCH}': PASS {pass_d:+d} /
FAIL {fail_d:+d} / ERROR {error_d:+d} / SKIP {skip_d:+d}"""
)

# If results are worse, check if we should fail the job
if pass_d < 0:
print(
f"::error ::PASS count is reduced from '{REPO_DEFAULT_BRANCH}': PASS {pass_d:+d} "
f"""::error ::PASS count is reduced from
'{REPO_DEFAULT_BRANCH}': PASS {pass_d:+d}"""
)

# Check if all failing tests are intermittent based on the environment variable
only_intermittent = ONLY_INTERMITTENT.lower() == 'true'
only_intermittent = ONLY_INTERMITTENT.lower() == "true"

if only_intermittent:
print("::notice ::All failing tests are in the ignored intermittent list")
Expand Down
1 change: 0 additions & 1 deletion util/gnu-json-result.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@
except Exception as e:
print(f"Error processing file {path}: {e}", file=sys.stderr)


print(json.dumps(out, indent=2, sort_keys=True))
6 changes: 3 additions & 3 deletions util/remaining-gnu-error.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
try:
urllib.request.urlretrieve(
"https://raw.githubusercontent.com/uutils/coreutils-tracking/main/gnu-full-result.json",
result_json
result_json,
)
except Exception as e:
print(f"Failed to download the file: {e}")
Expand All @@ -39,9 +39,9 @@
list_of_files = sorted(tests, key=lambda x: os.stat(x).st_size)


def show_list(l):
def show_list(list_test):
# Remove the factor tests and reverse the list (bigger first)
tests = list(filter(lambda k: "factor" not in k, l))
tests = list(filter(lambda k: "factor" not in k, list_test))

for f in reversed(tests):
if contains_require_root(f):
Expand Down
9 changes: 4 additions & 5 deletions util/size-experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ def config(name, val):

sizes = {}

for (strip, panic, opt, lto) in product(
STRIP_VALS, PANIC_VALS, OPT_LEVEL_VALS, LTO_VALS
):
for strip, panic, opt, lto in product(STRIP_VALS, PANIC_VALS, OPT_LEVEL_VALS, LTO_VALS):
if RECOMPILE:
cmd = [
"cargo",
Expand Down Expand Up @@ -77,8 +75,9 @@ def collect_diff(idx, name):
collect_diff(3, "lto")


def analyze(l):
return f"MIN: {float(min(l)):.3}, AVG: {float(sum(l)/len(l)):.3}, MAX: {float(max(l)):.3}"
def analyze(change):
return f"""MIN: {float(min(change)):.3},
AVG: {float(sum(change) / len(change)):.3}, MAX: {float(max(change)):.3}"""


print("Absolute changes")
Expand Down
Loading