Skip to content

Loading and logging improvements #528

Loading and logging improvements

Loading and logging improvements #528

Workflow file for this run

# SPDX-FileCopyrightText: 2022 - 2024 NRK
#
# SPDX-License-Identifier: MIT
name: Fuzz Test
on:
pull_request:
paths-ignore:
- '.github/'
branches:
- main
jobs:
FuzzTests:
strategy:
matrix:
tests: ["FuzzTokenAuth;./pkg/registry;60s", "FuzzRoutes;./pkg/registry;60s"]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version-file: "go.mod"
- name: Fuzz test
shell: bash
env:
TEST: "${{ matrix.tests }}"
run: |
IFS=";" read test pkg timeout <<<$TEST
go test "${pkg}" -fuzztime="${timeout}" -fuzz="${test}"
- name: Upload fuzz failure seed corpus as run artifact
if: failure()
uses: actions/[email protected]
with:
name: testdata
path: pkg/registry/testdata
- name: Report failure
uses: actions/[email protected]
if: failure() && github.event_name == 'pull_request'
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Fuzz test failed on ${{ github.event.pull_request.head.sha }}. To troubleshoot locally, use the [GitHub CLI](https://cli.github.com) to download the seed corpus with\n```\ngh run download ${{ github.run_id }} -n testdata\n```'
})