diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml deleted file mode 100644 index f414b2eae3..0000000000 --- a/.github/workflows/stats-pr.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Open Pull Request with updated stats report -on: - workflow_run: - workflows: ["Test Learning Path"] - types: [completed] -permissions: - actions: read - contents: write - pull-requests: write -jobs: - stats-pr: - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout main branch - uses: actions/checkout@v4 - with: - ref: main - - name: Download stats report as artifact - uses: actions/download-artifact@v4 - with: - # Run ID of the workflow that uploaded the artifact - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ github.token }} - - name: Check if artifact exists - run: | - if [ ! -d stats_current_test_info ]; then - echo "No stats artifact found" - echo "ARTIFACT_EXIST=false" >> "$GITHUB_ENV" - else - echo "Stats artifact found" - echo "ARTIFACT_EXIST=true" >> "$GITHUB_ENV" - fi - - name: Move stats file - # Unpack the artifact and move the stats file to the correct location - if: env.ARTIFACT_EXIST == 'true' - run: | - mv stats_current_test_info/stats_current_test_info.yml data/stats_current_test_info.yml - rm -rf stats_current_test_info - - name: Set workflow link as environment variable - if: env.ARTIFACT_EXIST == 'true' - run: echo "WORKFLOW_URL=${{ github.event.workflow_run.workflow_url }}" >> $GITHUB_ENV - - name: Echo Workflow URL - if: env.ARTIFACT_EXIST == 'true' - run: echo $WORKFLOW_URL - - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 - if: env.ARTIFACT_EXIST == 'true' && success() - with: - commit-message: Update stats_current_test_info.yml - title: Update stats_current_test_info.yml - body: | - Update test result file with recent run - Triggered by workflow run ${ WORKFLOW_URL } - Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request - branch: update-stats-current-test-info - base: main diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 5abdc17914..e4ca1204d8 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -91,10 +91,3 @@ jobs: - name: Check if maintenance is turned off if: env.MAINTENANCE == 'off' && success() run: echo "Maintenance is turned off for one or more files" - # Only upload artifact if maintenance is on - - name: Upload stats artifact - uses: actions/upload-artifact@v4 - if: success() && env.MAINTENANCE == 'on' - with: - name: stats_current_test_info - path: data/stats_current_test_info.yml diff --git a/.github/workflows/weekly_stats_update.yml b/.github/workflows/weekly_stats_update.yml index 1cc1b21e54..090a52f1f5 100644 --- a/.github/workflows/weekly_stats_update.yml +++ b/.github/workflows/weekly_stats_update.yml @@ -1,4 +1,4 @@ -# Result: updated files content/stats/stats_weekly_data.yml content/stats/stats_current_test_info.yml +# Result: updated file data/stats_weekly_data.yml # Will appear in learn.arm.com/stats name: Stats file weekly update @@ -57,7 +57,7 @@ jobs: # Commit updated files in a new PR - name: Commit updated stats files to repository run: | - git add data/stats_weekly_data.yml data/stats_current_test_info.yml + git add data/stats_weekly_data.yml # Push and commit only if changes to commit; if not, say so and end. git commit -m 'automatic update of stats files' && git push origin main || echo "No changes to commit" diff --git a/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md b/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md index dfb9eec38a..2a3cd179c0 100644 --- a/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md +++ b/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md @@ -242,38 +242,6 @@ The framework will print information about any errors to the console. To display ./tools/maintenance.py -i content/install-guides/mytool.md --debug ``` - -### Saving the results - -If you want the results to be saved, add the `--stats-report` flag to the command. This will update a statistics file `stats_current_test_info.yml`, which publishes the result to the website. In order to do that, the Learning Path or Install Guide needs to exist as an entry in the statistics file. Find the category for your content. If it's an Install Guide, the name will be that of the .md file without the extension. If it's a Learning Path, you will use the name of the directory. For example: - -``` -install-guides: - mytool: - readable_title: My Tool - tests_and_status: - - ubuntu:latest: passed -microcontrollers: - my-new-learning-path: - readable_title: My new Learning Path - tests_and_status: - - ubuntu:latest: passed -``` - -```bash -./tools/maintenance.py -i content/install-guides/mytool.md --stats-report -``` - -```yaml -tests_and_status: - - ubuntu:latest: passed - - fedora:latest: failed -``` - -The field `tests_and_status` is a list that indicated whether all tests passed for a corresponding Docker container image or if at least one test failed. - -In the example above, the summary indicates that for this Learning Path all tests passed for the image `ubuntu:latest` but at least one test failed for the image `fedora:latest`. More information about the failures can be found in the console. - ## Advanced usage for embedded development ### Using the Corstone-300 FVP diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml deleted file mode 100644 index ea39d57274..0000000000 --- a/data/stats_current_test_info.yml +++ /dev/null @@ -1,206 +0,0 @@ -summary: - content_total: 405 - content_with_all_tests_passing: 0 - content_with_tests_enabled: 61 -sw_categories: - automotive: {} - cross-platform: - dynamic-memory-allocator: - readable_title: Write a Dynamic Memory Allocator - tests_and_status: [] - intrinsics: - readable_title: Porting architecture specific intrinsics - tests_and_status: [] - embedded-and-microcontrollers: - tfm: - readable_title: Get started with Trusted Firmware-M - tests_and_status: [] - zephyr: - readable_title: Run the Zephyr RTOS on Arm Corstone-300 - tests_and_status: [] - install-guides: - acfl: - readable_title: Arm Compiler for Linux - tests_and_status: [] - ambaviz: - readable_title: Arm AMBA Viz - tests_and_status: [] - ams: - readable_title: Arm Performance Studio - tests_and_status: [] - anaconda: - readable_title: Anaconda - tests_and_status: [] - ansible: - readable_title: Ansible - tests_and_status: [] - aperf: - readable_title: APerf - tests_and_status: - - ubuntu:latest: passed - arduino-pico: - readable_title: Arduino core for the Raspberry Pi Pico - tests_and_status: [] - arm-gnu: - readable_title: Arm GNU Toolchain - tests_and_status: [] - armclang: - readable_title: Arm Compiler for Embedded - tests_and_status: [] - armds: - readable_title: Arm Development Studio - tests_and_status: [] - armie: - readable_title: Arm Instruction Emulator (armie) - tests_and_status: [] - armpl: - readable_title: Arm Performance Libraries - tests_and_status: [] - aws-cli: - readable_title: AWS CLI - tests_and_status: [] - aws-copilot: - readable_title: AWS Copilot CLI - tests_and_status: [] - aws-q-cli: - readable_title: Amazon Q Developer CLI - tests_and_status: [] - azure-cli: - readable_title: Azure CLI - tests_and_status: [] - bedrust: - readable_title: Bedrust - invoke models on Amazon Bedrock - tests_and_status: [] - bolt: - readable_title: BOLT - tests_and_status: [] - cross: - readable_title: Cross-compiler - tests_and_status: [] - cyclonedds: - readable_title: Cyclone DDS - tests_and_status: [] - dotnet: - readable_title: .NET SDK - tests_and_status: [] - eksctl: - readable_title: AWS EKS CLI (eksctl) - tests_and_status: [] - forge: - readable_title: Linaro Forge - tests_and_status: [] - gcloud: - readable_title: Google Cloud Platform (GCP) CLI - tests_and_status: [] - gfortran: - readable_title: GFortran - tests_and_status: [] - github-copilot: - readable_title: GitHub Copilot - tests_and_status: - - ubuntu:latest: passed - go: - readable_title: Go - tests_and_status: [] - kubectl: - readable_title: Kubectl - tests_and_status: [] - multipass: - readable_title: Multipass - tests_and_status: [] - native: - readable_title: Native compiler - tests_and_status: [] - oci-cli: - readable_title: Oracle Cloud Infrastructure (OCI) CLI - tests_and_status: [] - papi: - readable_title: Performance API (PAPI) - tests_and_status: [] - perf: - readable_title: Perf for Linux on Arm (LinuxPerf) - tests_and_status: [] - pulumi: - readable_title: Pulumi - tests_and_status: [] - pytorch: - readable_title: PyTorch - tests_and_status: - - ubuntu:latest: passed - ros2: - readable_title: ROS - Robot Operating System - tests_and_status: [] - rust: - readable_title: Rust for Linux Applications - tests_and_status: [] - rust_embedded: - readable_title: Rust for Embedded Applications - tests_and_status: [] - ssh: - readable_title: SSH - tests_and_status: [] - streamline-cli: - readable_title: Streamline CLI Tools - tests_and_status: [] - swift: - readable_title: Swift - tests_and_status: [] - sysbox: - readable_title: Sysbox - tests_and_status: [] - terraform: - readable_title: Terraform - tests_and_status: [] - topdown-tool: - readable_title: Telemetry Solution (Topdown Methodology) - tests_and_status: [] - vnc: - readable_title: VNC on Arm Linux - tests_and_status: [] - iot: {} - laptops-and-desktops: {} - mobile-graphics-and-gaming: {} - servers-and-cloud-computing: - clickhouse: - readable_title: Measure performance of ClickHouse on Arm servers - tests_and_status: [] - codec: - readable_title: Run x265 (H.265 codec) on Arm servers - tests_and_status: [] - geekbench: - readable_title: Get started with Geekbench on Arm - tests_and_status: [] - memcached: - readable_title: Run memcached on Arm servers and measure its performance - tests_and_status: [] - memcached_cache: - readable_title: Deploy Memcached as a cache for MySQL and PostgreSQL on Arm - based servers - tests_and_status: [] - ml-perf: - readable_title: Measure Machine Learning Inference Performance on Arm servers - tests_and_status: [] - mysql_tune: - readable_title: Learn how to Tune MySQL - tests_and_status: [] - nginx: - readable_title: Learn how to deploy Nginx - tests_and_status: - - ubuntu:latest: passed - postgresql_tune: - readable_title: Learn how to Tune PostgreSQL - tests_and_status: - - ubuntu:latest: passed - ran: - readable_title: Get started with the Arm 5G RAN Acceleration Library (ArmRAL) - tests_and_status: [] - snappy: - readable_title: Measure performance of compression libraries on Arm servers - tests_and_status: [] - vectorscan: - readable_title: Install Vectorscan (Hyperscan on Arm) and use it with Snort - 3 - tests_and_status: [] - zlib: - readable_title: Learn how to build and use Cloudflare zlib on Arm servers - tests_and_status: [] diff --git a/themes/arm-design-system-hugo-theme/layouts/install-guides/installtoolsall.html b/themes/arm-design-system-hugo-theme/layouts/install-guides/installtoolsall.html index c79c57bf16..2548b702f8 100644 --- a/themes/arm-design-system-hugo-theme/layouts/install-guides/installtoolsall.html +++ b/themes/arm-design-system-hugo-theme/layouts/install-guides/installtoolsall.html @@ -14,7 +14,6 @@ - partial general-formatting/github-links.html - partial navigation/content-navigation-mobile.html - partial general-formatting/external-link.html - - partial test-maintenance/test-maintenance.html - partial general-formatting/feedback.html - partial general-formatting/feedback.html */}} diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/general-formatting/metadata-table.html b/themes/arm-design-system-hugo-theme/layouts/partials/general-formatting/metadata-table.html index cfc919af1e..85b9bdb66b 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/general-formatting/metadata-table.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/general-formatting/metadata-table.html @@ -145,16 +145,6 @@

{{$page_h2}}

{{end}} - {{ if .Params.test_maintenance}} - - - Test status: - - - {{ partial "test-maintenance/test-maintenance" . }} - - - {{end}} @@ -199,18 +189,6 @@

{{$page_h2}}

{{end}} - {{ if .Params.test_maintenance}} - - - Test status: - - - - - {{ partial "test-maintenance/test-maintenance" . }} - - - {{end}} diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/test-maintenance/test-maintenance.html b/themes/arm-design-system-hugo-theme/layouts/partials/test-maintenance/test-maintenance.html deleted file mode 100644 index 334281e0c6..0000000000 --- a/themes/arm-design-system-hugo-theme/layouts/partials/test-maintenance/test-maintenance.html +++ /dev/null @@ -1,96 +0,0 @@ -{{/* -Publishes test result with a badge. - -Where it is used: - - install guides - - learning path introduction - -Called from: - - install-guides/installtoolsall.html - - partials learning-paths/introduction.html - - -Usage: in article header -# Maintenance settings -test_maintenance: true # Enables maintenance tests on article -*/}} - - - -{{ if eq true $.Page.Params.test_maintenance }} - {{ $path := .RelPermalink }} - - {{/* Split the path by "/" and manually build the path array using slice */}} - {{ $splitPath := strings.Split $path "/" }} - {{ $pathArray := slice }} - {{ range $i, $v := $splitPath }} - {{ if and (ne $v "") (ne $i (sub (len $splitPath) 1)) }} {{/* Skip empty elements and the last empty element */}} - {{ $pathArray = $pathArray | append $v }} - {{ end }} - {{ end }} - - - {{ $base := .Site.Data.stats_current_test_info.sw_categories }} - {{ $desiredKey := ""}} - - {{ if in $pathArray "learning-paths" }} - {{ $desiredKey = index $base (index $pathArray 1) (index $pathArray 2) }} - {{else}} - {{/* Multi-dir check for install guides */}} - {{ if eq (len $pathArray) 3 }} - {{ $desiredKey = index $base (index $pathArray 0) (index $pathArray 2) }} - {{else}} - {{ $desiredKey = index $base (index $pathArray 0) (index $pathArray 1) }} - {{end}} - {{end}} - - {{ range (index $desiredKey "tests_and_status") }} - {{range $image, $pass_or_fail := .}} - - {{ $image_filtered := replace $image ":" "_"}} - {{ $image_filtered := replace $image_filtered "/" "_"}} - {{ if eq "passed" $pass_or_fail }} - {{ $image }} - passed - {{ else }} - {{ $image }} - failed - {{ end }} - - {{end}} - - {{ end }} -{{ end }} - - - - - - - - - - - - -{{/* Getting it from the _index.md page itself, initial implementation only. Switched to Data file; can remove this now. -{{ if eq true $.Page.Params.test_maintenance }} - {{ range $idx, $el := $.Page.Params.test_images }} - {{ if $.Page.Params.test_link }} - - {{ end }} - {{ if $.Page.Params.test_status }} - {{ $st := (index $.Page.Params.test_status $idx) }} - {{ $el_m := replace $el ":" "_"}} - {{ $el_m := replace $el_m "/" "_"}} - {{ if eq "passed" $st }} - {{ $el }} - passed - {{ else }} - {{ $el }} - FAILED - {{ end }} - {{ end }} - {{if $.Page.Params.test_link }} - - {{ end }} - {{ end }} -{{ end }} - -*/}} \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/layouts/shortcodes/test.html b/themes/arm-design-system-hugo-theme/layouts/shortcodes/test.html deleted file mode 100644 index a75748c501..0000000000 --- a/themes/arm-design-system-hugo-theme/layouts/shortcodes/test.html +++ /dev/null @@ -1,34 +0,0 @@ -{{/* -Publishes test result with a badge - Usage: in article header - # Maintenance settings - test_maintenance: true # Enables maintenance tests on article - test_images: # List Docker images to run instructions on - - ubuntu:latest - - fedora:latest - test_link: https://github.com/USERNAME/arm-software-developers-ads/actions/runs/123456789 - test_status: - - passed - - failed -*/}} - - -{{ if eq true $.Page.Params.test_maintenance }} - {{ range $idx, $el := $.Page.Params.test_images }} - {{ if $.Page.Params.test_link }} - - {{ end }} - {{ if $.Page.Params.test_status }} - {{ $st := (index $.Page.Params.test_status $idx) }} - {{ $el_m := replace $el ":" "_"}} - {{ if eq "passed" $st }} - {{ $el }} - passed - {{ else }} - {{ $el }} - FAILED - {{ end }} - {{ end }} - {{if $.Page.Params.test_link }} - - {{ end }} - {{ end }} -{{ end }} diff --git a/themes/arm-design-system-hugo-theme/layouts/stats/list.html b/themes/arm-design-system-hugo-theme/layouts/stats/list.html index b2f8064dd9..b399c1ba64 100644 --- a/themes/arm-design-system-hugo-theme/layouts/stats/list.html +++ b/themes/arm-design-system-hugo-theme/layouts/stats/list.html @@ -193,93 +193,6 @@

Authors

-
-
-
- -
-
-

Tests

-
-
-
-
-
- - -

Number of content with failing tests:

-

{{ sub .Site.Data.stats_current_test_info.summary.content_with_tests_enabled .Site.Data.stats_current_test_info.summary.content_with_all_tests_passing}}

-
-
- - -

Content currently tested percentage:

- {{$total := float .Site.Data.stats_current_test_info.summary.content_total}} - {{$passed:= float .Site.Data.stats_current_test_info.summary.content_with_all_tests_passing }} -

{{ printf "%.1f%%" (mul (div $passed $total) 100.0) }}

-
-
-
-
-
- - -
-
-
- - - - - - - - - {{ range $key, $details := .Site.Data.stats_current_test_info.sw_categories }} - {{if $details}} - - - - {{ range $name, $info := $details}} - - - - - {{end}} - {{end}} - {{ end }} - -
- Content Name - - Test Status -
- {{replace $key "-" " " | title}} -
- {{$level_one_dir := "/learning-paths/"}} - {{if eq $key "install-guides"}} - {{$level_one_dir = "/"}} - {{end}} - {{/* {{$info.readable_title}} */}} - {{$info.readable_title}} - -
    - {{range $index, $test_status := $info.tests_and_status}} - {{range $k, $v := $test_status}} - {{- if eq $v "passed" -}} - - {{$k}}: {{$v}} - {{- else -}} - - {{$k}}: {{$v}} - {{end}} -
    - {{end}} - {{end}} -
-
-
-
-
-
diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/amd64_ubuntu_latest-failed-red.svg b/themes/arm-design-system-hugo-theme/static/img/badges/amd64_ubuntu_latest-failed-red.svg deleted file mode 100644 index e6f848e4a0..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/amd64_ubuntu_latest-failed-red.svg +++ /dev/null @@ -1 +0,0 @@ -amd64/ubuntu: failedamd64/ubuntufailed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/amd64_ubuntu_latest-passed-green.svg b/themes/arm-design-system-hugo-theme/static/img/badges/amd64_ubuntu_latest-passed-green.svg deleted file mode 100644 index c9ce52a8ab..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/amd64_ubuntu_latest-passed-green.svg +++ /dev/null @@ -1 +0,0 @@ -amd64/ubuntu: passedamd64/ubuntupassed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/arm64v8_ubuntu_latest-failed-red.svg b/themes/arm-design-system-hugo-theme/static/img/badges/arm64v8_ubuntu_latest-failed-red.svg deleted file mode 100644 index c4440e7d36..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/arm64v8_ubuntu_latest-failed-red.svg +++ /dev/null @@ -1 +0,0 @@ -arm64v8/ubuntu: failedarm64v8/ubuntufailed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/arm64v8_ubuntu_latest-passed-green.svg b/themes/arm-design-system-hugo-theme/static/img/badges/arm64v8_ubuntu_latest-passed-green.svg deleted file mode 100644 index 51f88d6350..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/arm64v8_ubuntu_latest-passed-green.svg +++ /dev/null @@ -1 +0,0 @@ -arm64v8/ubuntu: passedarm64v8/ubuntupassed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/armswdev_arm-tools_bare-metal-compilers-failed-red.svg b/themes/arm-design-system-hugo-theme/static/img/badges/armswdev_arm-tools_bare-metal-compilers-failed-red.svg deleted file mode 100644 index c968fbe98d..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/armswdev_arm-tools_bare-metal-compilers-failed-red.svg +++ /dev/null @@ -1 +0,0 @@ -armswdev/arm-tools:bare-metal-compilers: failedarmswdev/arm-tools:bare-metal-compilersfailed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/armswdev_arm-tools_bare-metal-compilers-passed-green.svg b/themes/arm-design-system-hugo-theme/static/img/badges/armswdev_arm-tools_bare-metal-compilers-passed-green.svg deleted file mode 100644 index c972662a96..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/armswdev_arm-tools_bare-metal-compilers-passed-green.svg +++ /dev/null @@ -1 +0,0 @@ -armswdev/arm-tools:bare-metal-compilers: passedarmswdev/arm-tools:bare-metal-compilerspassed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/fedora_latest-failed-red.svg b/themes/arm-design-system-hugo-theme/static/img/badges/fedora_latest-failed-red.svg deleted file mode 100644 index 0c6d12c6d2..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/fedora_latest-failed-red.svg +++ /dev/null @@ -1 +0,0 @@ -fedora:latest: failedfedora:latestfailed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/fedora_latest-passed-green.svg b/themes/arm-design-system-hugo-theme/static/img/badges/fedora_latest-passed-green.svg deleted file mode 100644 index 10b827e73a..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/fedora_latest-passed-green.svg +++ /dev/null @@ -1 +0,0 @@ -fedora:latest: passedfedora:latestpassed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/mongo_latest-failed-red.svg b/themes/arm-design-system-hugo-theme/static/img/badges/mongo_latest-failed-red.svg deleted file mode 100644 index df1c55319e..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/mongo_latest-failed-red.svg +++ /dev/null @@ -1 +0,0 @@ -mongo:latest: failedmongo:latestfailed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/mongo_latest-passed-green.svg b/themes/arm-design-system-hugo-theme/static/img/badges/mongo_latest-passed-green.svg deleted file mode 100644 index 3e62cff51a..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/mongo_latest-passed-green.svg +++ /dev/null @@ -1 +0,0 @@ -mongo:latest: passedmongo:latestpassed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/ubuntu_latest-failed-red.svg b/themes/arm-design-system-hugo-theme/static/img/badges/ubuntu_latest-failed-red.svg deleted file mode 100644 index 105fcd8580..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/ubuntu_latest-failed-red.svg +++ /dev/null @@ -1 +0,0 @@ -ubuntu:latest: failedubuntu:latestfailed \ No newline at end of file diff --git a/themes/arm-design-system-hugo-theme/static/img/badges/ubuntu_latest-passed-green.svg b/themes/arm-design-system-hugo-theme/static/img/badges/ubuntu_latest-passed-green.svg deleted file mode 100644 index df30845b1c..0000000000 --- a/themes/arm-design-system-hugo-theme/static/img/badges/ubuntu_latest-passed-green.svg +++ /dev/null @@ -1 +0,0 @@ -ubuntu:latest: passedubuntu:latestpassed \ No newline at end of file diff --git a/tools/maintenance.py b/tools/maintenance.py index f5f1999b1f..301fa59dc7 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -7,7 +7,6 @@ # Local import import report import parse -import patch import check import filter_checker @@ -87,7 +86,6 @@ def main(): arg_parser.add_argument('-l', '--link', metavar='URL', action='store', type=str, help='Specify URL to github actions report. Added when patching sources files with --instructions') arg_parser.add_argument('-p', '--patch', action='store_true', help='Patch categories _index.md with results when using --filter-checker') arg_parser.add_argument('-t', '--type', metavar='REPORT', action='store', default='all', type=str, help='Specify report type detailing the closed filter status when using --filter-checker. Can be either \'all\', \'subjects\', \'softwares\', \'oses\', \'tools\'') - arg_parser.add_argument('-sr', '--stats-report', action='store_true', help='Added when patching statistics file with --instructions') arg_group = arg_parser.add_mutually_exclusive_group() arg_group.add_argument('-f', '--filter-checker', action='store_true', help='Validates the correct closed schema filters are being used, reports any errors, and optionally updates _index.md files for each learning path category to reflect the currently supported filters.') @@ -154,9 +152,6 @@ def main(): results_dict = check_lp(args.instructions, args.link, args.debug) else: logging.error("-i/--instructions expects a .md file, a CSV with a list of files or a Learning Path directory") - if args.stats_report: - # If all test results are zero, all tests have passed - patch.patch(args.instructions, results_dict, args.link) if results_dict is not None: if all(results_dict.get(k) for k in results_dict): # Errors exist diff --git a/tools/patch.py b/tools/patch.py deleted file mode 100644 index 2ecbd5dcb9..0000000000 --- a/tools/patch.py +++ /dev/null @@ -1,59 +0,0 @@ -import yaml -from collections import defaultdict -from pathlib import PurePath -import re - -""" -Parse results and patch stats file with test results -""" -def patch(article_path: str, results: dict, link: str): - stats_file = "data/stats_current_test_info.yml" - - with open(stats_file, mode='r') as f: - data = yaml.safe_load(f) - f.close() - - article_path_pure = PurePath(re.sub(r"^.*?content/", "", article_path)) - article_path_parts = list(article_path_pure.parts) - if "learning-paths" in article_path_parts: - content_type, sw_category, content_title, *others = article_path_parts - article_path = PurePath(article_path, "_index.md") - elif "install-guides" in article_path_parts: - # In case the install guide is in a subdirectory - if len(article_path_parts) > 3: - content_type, subdirectory, content_title, *others = article_path_parts - else: - content_type, content_title, *others = article_path_parts - # Remove ".md" from the content title if it exists - content_title = content_title[:-3] if content_title.endswith(".md") else content_title - sw_category = content_type - else: - raise SystemExit("Unknown content path, pass learning paths or install guides only") - - test_images = results.keys() - results_values = defaultdict(lambda: "failed") - results_values[0] = "passed" - - content_data = data["sw_categories"][sw_category][content_title] - - # Create 'tests_and_status' if it doesn't exist - if "tests_and_status" not in content_data or not isinstance(content_data["tests_and_status"], list): - content_data["tests_and_status"] = [{} for _ in range(len(test_images))] - - # If 'tests_and_status' exists but is too short, extend it - if len(content_data["tests_and_status"]) < len(test_images): - additional_entries = [{} for _ in range(len(test_images) - len(content_data["tests_and_status"]))] - content_data["tests_and_status"].extend(additional_entries) - - # Now safe to index - for i, image in enumerate(test_images): - idx = min(i, len(content_data["tests_and_status"]) - 1) - content_data["tests_and_status"][idx][image] = results_values[results[image]] - - if link: - data["sw_categories"][sw_category][content_title]["test_link"] = link - - - with open(stats_file, mode='w') as f: - yaml.dump(data, f) - f.close() \ No newline at end of file diff --git a/tools/stats_data_generate.py b/tools/stats_data_generate.py index cb1dd571c0..54e743b97b 100644 --- a/tools/stats_data_generate.py +++ b/tools/stats_data_generate.py @@ -85,7 +85,6 @@ # Set paths data_weekly_file_path = Path('../data/stats_weekly_data.yml') -tests_status_file_path = Path('../data/stats_current_test_info.yml') learning_path_dir = Path('../content/learning-paths/') install_guide_dir = Path('../content/install-guides/') lp_and_ig_content_dirs = ['embedded-and-microcontrollers','iot','laptops-and-desktops','servers-and-cloud-computing','mobile-graphics-and-gaming','automotive','cross-platform','install-guides'] @@ -96,7 +95,6 @@ # Set global vars for processing ease new_weekly_entry = {} -new_tests_entry = {} ############################################################################# ############################################################################# @@ -110,14 +108,11 @@ def pretty(d, indent=0): else: print('\t' * (indent+1) + str(value)) -def printInfo(week,test): +def printInfo(week): print('============================================================================') print('New weekly entry dict appended:') pretty(week) print('============================================================================') - print('New test entry dict overwriting:') - pretty(test) - print('============================================================================') def urlize(in_str): @@ -188,14 +183,8 @@ def iterateContentIndexMdFiles(): # weekly -> authors AND contributions weekly_authors_contributions_dic = {'individual_authors': {}, 'contributions':{'internal': 0, 'external': 0}} - # tests -> summary: - content_total = 0 - content_with_tests_enabled = 0 - content_with_all_tests_passing = 0 - # start iterating over all sw_categories including install guides for category in lp_and_ig_content_dirs: - new_tests_entry['sw_categories'][category] = {} # Add new category key # Get list of content to iterate over. content_in_dir = [] @@ -233,49 +222,13 @@ def iterateContentIndexMdFiles(): continue - # Add to content total (both tests and weekly places for redundency sake) + # Add to content total (weekly) weekly_count_dic['total'] = weekly_count_dic['total'] + 1 - content_total = content_total + 1 # Add to category total weekly_count_dic[category] = weekly_count_dic[category] + 1 ######### AUTHOR info weekly_authors_contributions_dic = authorAdd(content_metadic['author'],weekly_authors_contributions_dic) - - - # Record entry in test file - try: - if content_metadic['test_maintenance']: # if actively being tested, record as such - # Record test - content_with_tests_enabled = content_with_tests_enabled + 1 - - # Add an entry for this dir, with title and test status keys - if category == 'install-guides': # Install Guides, shorthand name is the .md file name itself (for multi-part installs, still the individual file name; dir name is ignored) - content_dir_name = content_index_file.stem - else: # Learning Paths, shorthand name is the directory - content_dir_name = os.path.basename(os.path.dirname(content_index_file)) - - new_tests_entry['sw_categories'][category][content_dir_name] = {} - new_tests_entry['sw_categories'][category][content_dir_name]['readable_title'] = content_metadic['title'] - new_tests_entry['sw_categories'][category][content_dir_name]['tests_and_status'] = [] - all_tests_passing = True # Default to true, change if one is false - for i, item in enumerate(content_metadic['test_status']): - # Record test status (possibily multiple) - new_tests_entry['sw_categories'][category][content_dir_name]['tests_and_status'].append({ - content_metadic['test_images'][i]: content_metadic['test_status'][i] - }) - if item != 'passed': - all_tests_passing = False - # Add if tests are passing count if all tests under this content are passing - if all_tests_passing: - content_with_all_tests_passing = content_with_all_tests_passing + 1 - except: - pass - - # Update all totals for tests passing or not into the summary - new_tests_entry['summary']['content_total'] = content_total - new_tests_entry['summary']['content_with_tests_enabled'] = content_with_tests_enabled - new_tests_entry['summary']['content_with_all_tests_passing'] = content_with_all_tests_passing # Update stats new_weekly_entry['content'] = weekly_count_dic @@ -356,7 +309,7 @@ def callGitHubAPI(GitHub_token,GitHub_repo_name): def main(): - global data_weekly_file_path, tests_status_file_path, learning_path_dir, install_guide_dir, date_today, new_weekly_entry, new_tests_entry + global data_weekly_file_path, learning_path_dir, install_guide_dir, date_today, new_weekly_entry # Read in params needed for reading GitHub API arg_parser = argparse.ArgumentParser(description='Update Stats') @@ -368,7 +321,6 @@ def main(): # Read in data file as python dict existing_weekly_dic = yaml.safe_load(data_weekly_file_path.read_text()) - existing_tests_dic = yaml.safe_load(tests_status_file_path.read_text()) # Structure new data formats: new_weekly_entry = { @@ -380,11 +332,6 @@ def main(): "github_engagement": {} } - new_tests_entry = { - "summary": {}, - "sw_categories":{} - } - # Get new stats, filling in new stat dictionaries: iterateContentIndexMdFiles() @@ -393,7 +340,7 @@ def main(): # Debug prints in flow - printInfo(new_weekly_entry,new_tests_entry) + printInfo(new_weekly_entry) # Update/replace yaml files @@ -423,10 +370,5 @@ def main(): print(existing_weekly_dic) yaml.dump(existing_weekly_dic, outfile, default_flow_style=False) - ### Tests - existing_tests_dic = new_tests_entry - with open(tests_status_file_path, 'w') as outfile: - yaml.dump(existing_tests_dic, outfile, default_flow_style=False) - if __name__ == "__main__": main() diff --git a/tools/test_lp.sh b/tools/test_lp.sh index 3becf4e28e..d7698c9799 100755 --- a/tools/test_lp.sh +++ b/tools/test_lp.sh @@ -20,5 +20,5 @@ CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Run the tests for file in ${CONTENT_PATHS_UNIQUE[*]}; do - tools/maintenance.py -i ${file} --stats-report + tools/maintenance.py -i ${file} done