Skip to content

Commit 15adbab

Browse files
authored
feat: optional tests (#716)
1 parent 0a45aee commit 15adbab

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

Diff for: .github/workflows/ci_test_vector_net.yml

+2
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,7 @@ jobs:
5858
- name: Test TestVectors
5959
working-directory: ./TestVectors/runtimes/net
6060
run: |
61+
cp ../java/decrypt_java.json ../java/decrypt_dotnet.json .
62+
dotnet run
6163
cp ../java/*.json .
6264
dotnet run

Diff for: TestVectors/dafny/DDBEncryption/src/Index.dfy

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ module WrappedDDBEncryptionMain {
1717

1818
method AddJson(prev : TestVectorConfig, file : string) returns (output : Result<TestVectorConfig, string>)
1919
{
20-
var configBv :- expect FileIO.ReadBytesFromFile(file);
21-
var configBytes := BvToBytes(configBv);
20+
var configBv := FileIO.ReadBytesFromFile(file);
21+
if configBv.Failure? {
22+
print "Failed to open ", file, " continuing anyway.\n";
23+
return Success(MakeEmptyTestVector());
24+
}
25+
var configBytes := BvToBytes(configBv.value);
2226
var json :- expect API.Deserialize(configBytes);
2327
output := ParseTestVector(json, prev);
2428
if output.Failure? {

Diff for: TestVectors/dafny/DDBEncryption/src/TestVectors.dfy

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
9191
var _ :- expect WriteManifest.Write("encrypt.json");
9292
var _ :- expect EncryptManifest.Encrypt("encrypt.json", "decrypt.json", "java", "3.2");
9393
var _ :- expect DecryptManifest.Decrypt("decrypt.json");
94+
if |globalRecords| + |tableEncryptionConfigs| + |queries| == 0 {
95+
print "\nRunning no tests\n";
96+
return;
97+
}
9498
Validate();
9599
StringOrdering();
96100
BasicIoTest();

0 commit comments

Comments
 (0)