Skip to content

chore: add verify test for test vectors #897

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

Merged
merged 2 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
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
64 changes: 64 additions & 0 deletions .github/workflows/ci_tv_verification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This workflow performs verification checks
name: test vector verification

on:
pull_request:
push:
branches:
- main
workflow_dispatch:
# Manual trigger for this workflow, either the normal version
# or the nightly build that uses the latest Dafny prerelease
# (accordingly to the "nightly" parameter).
inputs:
nightly:
description: 'Run the nightly build'
required: false
type: boolean
schedule:
# Nightly build against Dafny's nightly prereleases,
# for early warning of verification issues or regressions.
# Timing chosen to be adequately after Dafny's own nightly build,
# but this might need to be tweaked:
# https://github.com/dafny-lang/dafny/blob/master/.github/workflows/deep-tests.yml#L16
- cron: "30 16 * * *"

jobs:
verification:
# Don't run the nightly build on forks
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
strategy:
matrix:
# Break up verification between namespaces over multiple
# actions to take advantage of parallelization
service: [
DDBEncryption
]
os: [
macos-latest,
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
# A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports.
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}

- name: Verify ${{ matrix.library }} Dafny code
shell: bash
working-directory: ./TestVectors
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make verify_service CORES=$CORES SERVICE=${{ matrix.service }}

- name: Check solver resource use
shell: bash
working-directory: ./TestVectors
run: |
make dafny-reportgenerator
2 changes: 1 addition & 1 deletion TestVectors/dafny/DDBEncryption/src/TestVectors.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
var res := client.Query(GetQueryInput(failingQueries[i], usedNames, usedValues));
expect res.Failure?;
}
var results := new DDB.ItemList[|queries|];
var results := new DDB.ItemList[|queries|](i => []);
for i := 0 to |queries| {
results[i] := FullSearch(client, queries[i]);
}
Expand Down
Loading