Skip to content

Commit

Permalink
chore(aws_signature_v4): Update test loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon Nys committed Apr 20, 2022
1 parent 1deba24 commit 58447f6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/aws_signature_v4/test/c_test_suite/test_data_loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ const Map<String, TestFileParser> _fileParsers = {
/// Parses raw HTTP requests.
final _requestParser = SignerRequestParser();

/// Test cases to skip.
///
/// See: https://github.com/awslabs/aws-c-auth/issues/160
const skipTestCases = [
'get-vanilla-query-order-key',
'get-vanilla-query-order-value',
];

/// Loads all test cases in the C signer test suite by walking the file tree
/// and creating a [SignerTest] for each folder encountered where all requisite
/// files are available.
Expand All @@ -68,6 +76,10 @@ Future<List<SignerTest>> loadAllTests() async {
final testCaseName = path.basename(entity.path);
final testCaseBuilder = SignerTestBuilder(testCaseName);

if (skipTestCases.contains(testCaseName)) {
continue;
}

// List all the files in the test directory and sort them alphabetically.
// This is required to ensure that `context.json` is the first file parsed,
// since its data is used to parse other files accordingly, namely `request.txt`.
Expand All @@ -83,8 +95,7 @@ Future<List<SignerTest>> loadAllTests() async {
// they are borrowing the rest of the files from other folders, but it's not
// clear. This represents only 2 tests, as of writing.
if (testFiles.length < 10) {
print('Warning: $testCaseName does not include all necessary files');
continue;
throw Exception('$testCaseName does not include all necessary files');
}

for (var testFile in testFiles) {
Expand Down

0 comments on commit 58447f6

Please sign in to comment.