diff --git a/.github/workflows/gnu-data.yml b/.github/workflows/gnu-data.yml index 4aa727498..d5774b26e 100644 --- a/.github/workflows/gnu-data.yml +++ b/.github/workflows/gnu-data.yml @@ -132,9 +132,9 @@ jobs: - name: Generate the graphs shell: bash run: | - python graph.py gnu-result.json gnu - python graph.py busybox-result.json busybox - python graph.py toybox-result.json toybox + python graph.py gnu-result.json GNU + python graph.py busybox-result.json BusyBox + python graph.py toybox-result.json Toybox python individual-size-graph.py individual-size-result.json python size-graph.py size-result.json diff --git a/README.md b/README.md index 6e27206a3..8a7c62bf3 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ Below is the evolution of how many GNU tests uutils passes. A more detailed breakdown of the GNU test results of the main branch can be found [in the user manual](https://uutils.github.io/coreutils/docs/test_coverage.html). -![GNU testsuite evolution](https://github.com/uutils/coreutils-tracking/blob/main/gnu-results.png?raw=true) +![GNU testsuite evolution](gnu-results.svg) -Refreshed twice a day by github actions. Changes are documented in the json file ([gnu-result.json](https://github.com/uutils/coreutils-tracking/blob/main/gnu-result.json)). +Refreshed twice a day by github actions. Changes are documented in the json file ([gnu-result.json](gnu-result.json)). Compares only the Linux execution. @@ -23,18 +23,18 @@ Based on: Similar results but using the busybox testsuite: https://github.com/mirror/busybox/tree/master/testsuite -![Busybox testsuite evolution](https://github.com/uutils/coreutils-tracking/blob/main/busybox-results.png?raw=true) +![Busybox testsuite evolution](busybox-results.svg) ## Toybox testsuite comparison Similar results but using the toybox testsuite: https://github.com/landley/toybox/tree/master/tests -![Toybox testsuite evolution](https://github.com/uutils/coreutils-tracking/blob/main/toybox-results.png?raw=true) +![Toybox testsuite evolution](toybox-results.svg) ## Binary size evolution -![Size evolution](https://github.com/uutils/coreutils-tracking/blob/main/size-results.png?raw=true) +![Size evolution](size-results.svg) Refreshed once a day by github actions. diff --git a/graph.py b/graph.py index c87f396cf..5bd9d5351 100644 --- a/graph.py +++ b/graph.py @@ -3,17 +3,13 @@ # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. -from datetime import datetime -from email.utils import parsedate - import sys -import time import matplotlib.pyplot as plt import pandas as pd if len(sys.argv) <= 2: - print('graph.py: ') + print("graph.py: <json file> <title>") sys.exit() d = pd.read_json(sys.argv[1], orient="index") @@ -22,24 +18,19 @@ title = sys.argv[2] df.columns.names = ["date"] -as_list = df.index.tolist() -for i in as_list: - idx = as_list.index(i) - t = parsedate(i) - as_list[idx] = datetime.fromtimestamp(time.mktime(t)) - -df.index = as_list +df.index = pd.to_datetime(df.index, utc=True) print(df) -ax = plt.gca() +fig, ax = plt.subplots(figsize=(9.6, 7.2)) df.plot(y="total", color="blue", ax=ax) df.plot(y="fail", color="gray", ax=ax, dashes=(2, 1)) df.plot(y="pass", color="green", ax=ax, dashes=(4, 1)) if "error" in df: df.plot(y="error", color="orange", ax=ax, dashes=(6, 2)) df.plot(y="skip", color="violet", ax=ax, dashes=(8, 3)) -plt.title("Rust/Coreutils running {}'s testsuite".format(title)) -plt.xticks(rotation=45) +plt.title(f"Rust/Coreutils running {title}'s testsuite") +fig.autofmt_xdate() +plt.margins(0.01) plt.ylim(ymin=0) -plt.savefig("{}-results.png".format(title), dpi=199) +plt.savefig(f"{title.lower()}-results.svg", format="svg", dpi=199, bbox_inches="tight") diff --git a/individual-size-graph.py b/individual-size-graph.py index b16b37025..165073336 100644 --- a/individual-size-graph.py +++ b/individual-size-graph.py @@ -14,11 +14,7 @@ df = pd.read_json(sys.argv[1], orient="index") Path("individual-size-results").mkdir(exist_ok=True) -df = pd.read_json(sys.argv[1], orient="index") - -Path("individual-size-results").mkdir(exist_ok=True) - -for name in df.sizes.values[0].keys(): +for name in df.sizes.values[0]: # Check if the name exists in each dictionary sizes = df.sizes.map(lambda v: v.get(name)) @@ -28,10 +24,12 @@ for name in df.sizes.values[0].keys(): if not sizes.empty: print(name) print(sizes) + fig, _ax = plt.subplots(figsize=(9.6, 7.2)) sizes.plot(y="size", color="green") plt.title(f'Size evolution of "{name}" binary (kilobytes)') - plt.xticks(rotation=45) - plt.savefig(f"individual-size-results/{name}.png", dpi=199) + fig.autofmt_xdate() + plt.margins(0.01) + plt.savefig(f"individual-size-results/{name}.svg", format="svg", dpi=199, bbox_inches="tight") plt.clf() else: print(f"Warning: No data found for '{name}'") diff --git a/size-graph.py b/size-graph.py index 774ea6135..f3edfce2f 100644 --- a/size-graph.py +++ b/size-graph.py @@ -3,11 +3,7 @@ # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. -from datetime import datetime -from email.utils import parsedate - import sys -import time import matplotlib.pyplot as plt import pandas as pd @@ -17,19 +13,14 @@ df = pd.DataFrame(d) df.columns.names = ["date"] -as_list = df.index.tolist() -for i in as_list: - idx = as_list.index(i) - t = parsedate(i) - as_list[idx] = datetime.fromtimestamp(time.mktime(t)) - -df.index = as_list +df.index = pd.to_datetime(df.index, utc=True, format="mixed") print(df) -ax = plt.gca() +fig, ax = plt.subplots(figsize=(9.6, 7.2)) df.plot(y="size", color="gray", ax=ax, dashes=(2, 1), label="Size: multiple binaries (byte)") df.plot(y="multisize", color="green", ax=ax, dashes=(4, 1), label="Size: multicall binary (byte)") plt.title("Size evolution of Rust/Coreutils") -plt.xticks(rotation=45) -plt.savefig("size-results.png", dpi=199) +fig.autofmt_xdate() +plt.margins(0.01) +plt.savefig("size-results.svg", format="svg", dpi=199, bbox_inches="tight")