Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fuzz tests on master #2012

Merged
merged 3 commits into from
Dec 7, 2023
Merged
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
57 changes: 51 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -583,14 +583,14 @@ jobs:
# fuzz

fuzz:
# Temporarily disabled until https://github.com/paritytech/ink/issues/1374
# is fixed.
runs-on: ubuntu-latest
needs: [set-image, examples-docs, examples-contract-build, examples-test]
if: >
false &&
github.event_name == 'push' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [set-image, measurements]

permissions:
issues: write
defaults:
run:
shell: bash
Expand All @@ -611,6 +611,7 @@ jobs:
uses: ./.github/rust-info

- name: Fuzz
id: fuzz_test
env:
QUICKCHECK_TESTS: 5000
run: |
Expand All @@ -625,3 +626,47 @@ jobs:
fi
done
exit ${all_tests_passed}

- name: Create Issue
if: ${{ failure() && steps.fuzz_test.conclusion == 'failure' }}

uses: actions/github-script@v6
with:
script: |
const runId = context.runId;

// Get the list of jobs for the current run using GitHub API
const jobs = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: runId
});

// Find the job ID by name
const job = jobs.data.jobs.find(job => job.name === context.job);

if (!job) {
console.error(`Job with name '${jobName}' not found.`);
return;
}

const jobId = job.id;
const title = "[ci] Failing fuzz tests on master ('" + new Date().toLocaleDateString() + "')";
const runUrl = context.serverUrl + "/" + context.repo.owner + "/" + context.repo.repo + "/actions/runs/" + runId + "/job/" + jobId;
const commitUrl = context.serverUrl + "/" + context.repo.owner + "/" + context.repo.repo + "/commit/" + context.sha;
const message = context.payload.head_commit.message;
const body = `
The CI job [${runId}](${runUrl}) just failed.

The offending commit is [${message}](${commitUrl}).
`;

const issue = await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: title,
body: body,
assignees: [],
labels: ['P-high']
});
console.log(`Issue created: ${issue.data.html_url}`);