Skip to content

Add more metadata to the json report #8

Description

@ev-br

Looking at https://github.com/ev-br/numpy/blob/main/.github/workflows/array-api-report.yml, there's a bit of metadata which needs to be manually added to the JSON report from the test suite:

          library_version="$(python -c "import importlib.metadata; print(importlib.metadata.version('${{ env.ARRAY_LIBRARY }}'))")"
          platform="$(python -c 'import platform; print(platform.platform())')"
          system="$(python -c 'import platform; print(platform.system())')"
          release="$(python -c 'import platform; print(platform.release())')"
          machine="$(python -c 'import platform; print(platform.machine())')"
          python_version="$(python -c 'import platform; print(platform.python_version())')"
          api_version="$(python -c 'import ${{ env.ARRAY_API_TESTS_MODULE }}; print(${{ env.ARRAY_API_TESTS_MODULE }}.__array_api_version__)')"
          test_suite="$(git rev-parse HEAD)"
          jq \
            --arg schema 'v1' \
            --arg name '${{ env.ARRAY_LIBRARY }}-fork' \
            --arg version "${library_version}" \
            --arg api_version "${api_version}" \
            --arg timestamp "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
            --arg platform "${platform}" \
            --arg system "${system}" \
            --arg release "${release}" \
            --arg machine "${machine}" \
            --arg execution_target 'cpu' \
            --arg python_version "${python_version}" \
            --arg test_suite "${test_suite}" \

Some of this data we either have in the test suite output itself or can add fairly easily:

  • name : this will have to stay in the workflow YML (because -fork)
  • version, api version: can add
  • timestamp: .report.json has a created field
  • platform, system, release, machine, python_version: can add

The question is whether it's worth adding since you already did the work to set up the current version @kgryte

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions