Skip to content

Commit 6c980e7

Browse files
authored
chore: add verify test for test vectors (#897)
* chore: add verify test for test vectors
1 parent dfc0dbd commit 6c980e7

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# This workflow performs verification checks
2+
name: test vector verification
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
# Manual trigger for this workflow, either the normal version
11+
# or the nightly build that uses the latest Dafny prerelease
12+
# (accordingly to the "nightly" parameter).
13+
inputs:
14+
nightly:
15+
description: 'Run the nightly build'
16+
required: false
17+
type: boolean
18+
schedule:
19+
# Nightly build against Dafny's nightly prereleases,
20+
# for early warning of verification issues or regressions.
21+
# Timing chosen to be adequately after Dafny's own nightly build,
22+
# but this might need to be tweaked:
23+
# https://github.com/dafny-lang/dafny/blob/master/.github/workflows/deep-tests.yml#L16
24+
- cron: "30 16 * * *"
25+
26+
jobs:
27+
verification:
28+
# Don't run the nightly build on forks
29+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
30+
strategy:
31+
matrix:
32+
# Break up verification between namespaces over multiple
33+
# actions to take advantage of parallelization
34+
service: [
35+
DDBEncryption
36+
]
37+
os: [
38+
macos-latest,
39+
]
40+
runs-on: ${{ matrix.os }}
41+
steps:
42+
- uses: actions/checkout@v3
43+
with:
44+
submodules: recursive
45+
46+
- name: Setup Dafny
47+
uses: dafny-lang/[email protected]
48+
with:
49+
# A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports.
50+
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}
51+
52+
- name: Verify ${{ matrix.library }} Dafny code
53+
shell: bash
54+
working-directory: ./TestVectors
55+
run: |
56+
# This works because `node` is installed by default on GHA runners
57+
CORES=$(node -e 'console.log(os.cpus().length)')
58+
make verify_service CORES=$CORES SERVICE=${{ matrix.service }}
59+
60+
- name: Check solver resource use
61+
shell: bash
62+
working-directory: ./TestVectors
63+
run: |
64+
make dafny-reportgenerator

TestVectors/dafny/DDBEncryption/src/TestVectors.dfy

+1-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
569569
var res := client.Query(GetQueryInput(failingQueries[i], usedNames, usedValues));
570570
expect res.Failure?;
571571
}
572-
var results := new DDB.ItemList[|queries|];
572+
var results := new DDB.ItemList[|queries|](i => []);
573573
for i := 0 to |queries| {
574574
results[i] := FullSearch(client, queries[i]);
575575
}

0 commit comments

Comments
 (0)