-
Notifications
You must be signed in to change notification settings - Fork 248
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
chore: Improve testing #1873
Merged
Merged
chore: Improve testing #1873
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5d7c36c
chore(auth): Improve testing
c86ebc6
chore(worker_bee): Refactor tests
687e7a4
chore(secure_storage): Refactor tests
c0e9611
chore(ci): Update workflows
4fb6b34
chore: Clean up
8c39a76
chore(aws_common): Add `zAssertsEnabled` global
44a5164
chore: Update test configurations
c03b184
chore: Update build configurations
6033e32
chore: Clean up
23af57b
chore(authenticator): Remove unused import
2b02533
chore(ci): Support more platforms
ec4d494
chore(core): Update `build.yaml`
3b9fd47
chore: Update `build.yaml`
34fb6f3
chore(auth): Temporarily remove DDC `dev` tests
c1f8101
chore(auth): Skip worker test on Chrome
50f8dc1
chore: Update `pubspec_overrides`
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
targets: | ||
$default: | ||
builders: | ||
build_web_compilers:entrypoint: | ||
release_options: | ||
dart2js_args: | ||
- --define=dart.vm.product=true | ||
- --enable-asserts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions
22
packages/auth/amplify_auth_cognito/example/pubspec_overrides.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
targets: | ||
$default: | ||
builders: | ||
build_web_compilers:entrypoint: | ||
release_options: | ||
dart2js_args: | ||
- --define=dart.vm.product=true |
22 changes: 22 additions & 0 deletions
22
packages/auth/amplify_auth_cognito_dart/example/pubspec_overrides.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated with `aft`. Do not modify by hand or check into source control. | ||
dependency_overrides: | ||
amplify_auth_cognito_dart: | ||
path: .. | ||
amplify_core: | ||
path: ../../../amplify_core | ||
amplify_lints: | ||
path: ../../../amplify_lints | ||
amplify_secure_storage_dart: | ||
path: ../../../secure_storage/amplify_secure_storage_dart | ||
aws_common: | ||
path: ../../../aws_common | ||
aws_signature_v4: | ||
path: ../../../aws_signature_v4 | ||
example_common: | ||
path: ../../../example_common | ||
smithy: | ||
path: ../../../smithy/smithy | ||
smithy_aws: | ||
path: ../../../smithy/smithy_aws | ||
worker_bee: | ||
path: ../../../worker_bee/worker_bee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Files and directories created by pub. | ||
.dart_tool/ | ||
.packages | ||
|
||
# Conventional directory for build output. | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Tests for the [`amplify_auth_cognito_dart`](../amplify_auth_cognito_dart) package separated out so that they can be easily tested using `build_runner`. | ||
|
||
## Testing | ||
|
||
To run tests: | ||
|
||
```sh | ||
$ dart test | ||
$ dart run build_runner test --delete-conflicting-outputs -- -p chrome,firefox | ||
$ dart run build_runner test --release --delete-conflicting-outputs -- -p chrome,firefox | ||
``` |
7 changes: 7 additions & 0 deletions
7
packages/auth/amplify_auth_cognito_test/analysis_options.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
include: package:amplify_lints/library.yaml | ||
|
||
analyzer: | ||
errors: | ||
invalid_use_of_internal_member: ignore | ||
exclude: | ||
- '**/*.g.dart' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
targets: | ||
$default: | ||
builders: | ||
build_web_compilers:entrypoint: | ||
release_options: | ||
dart2js_args: | ||
- --define=dart.vm.product=true | ||
- --enable-asserts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
override_platforms: | ||
firefox: | ||
settings: | ||
arguments: -headless | ||
on_platform: | ||
# Tests with workers seems to be really slow on browsers | ||
browser: | ||
timeout: 2x |
2 changes: 2 additions & 0 deletions
2
packages/auth/amplify_auth_cognito_test/lib/amplify_auth_cognito_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// Tests for the `amplify_auth_cognito_dart` package. | ||
library amplify_auth_cognito_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
sdk: | ||
- stable | ||
- dev | ||
|
||
stages: | ||
- analyze_and_format: | ||
- group: | ||
- format | ||
- analyze: --fatal-infos . | ||
- unit_test: | ||
- command: dart --version | ||
- test: | ||
os: | ||
- windows | ||
- macos | ||
- linux | ||
- command: dart run build_runner test --delete-conflicting-outputs -- -p chrome,firefox | ||
sdk: | ||
- stable | ||
# TODO(dnys1): https://github.com/dart-lang/sdk/issues/49474 | ||
# - dev | ||
- command: dart run build_runner test --release --delete-conflicting-outputs -- -p chrome,firefox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: amplify_auth_cognito_test | ||
description: Tests for the amplify_auth_cognito_dart package. | ||
publish_to: none | ||
|
||
environment: | ||
sdk: '>=2.17.0 <3.0.0' | ||
|
||
dependency_overrides: | ||
amplify_core: | ||
path: ../../amplify_core | ||
amplify_secure_storage_dart: | ||
path: ../../secure_storage/amplify_secure_storage_dart | ||
aws_common: | ||
path: ../../aws_common | ||
aws_signature_v4: | ||
path: ../../aws_signature_v4 | ||
worker_bee: | ||
path: ../../worker_bee/worker_bee | ||
|
||
dev_dependencies: | ||
amplify_auth_cognito_dart: | ||
path: ../amplify_auth_cognito_dart | ||
amplify_core: | ||
path: ../../amplify_core | ||
amplify_lints: | ||
path: ../../amplify_lints | ||
amplify_secure_storage_dart: | ||
path: ../../secure_storage/amplify_secure_storage_dart | ||
build_runner: ^2.0.0 | ||
build_test: ^2.0.0 | ||
build_web_compilers: ^3.2.2 | ||
built_collection: ^5.0.0 | ||
built_value: ^8.0.0 | ||
convert: ^3.0.0 | ||
http: ^0.13.0 | ||
mockito: ^5.0.0 | ||
smithy: | ||
hosted: https://pub.dillonnys.com | ||
version: ^0.5.0 | ||
smithy_aws: | ||
hosted: https://pub.dillonnys.com | ||
version: ^0.5.0 | ||
stream_transform: ^2.0.0 | ||
test: ^1.16.0 | ||
worker_bee: | ||
path: ../../worker_bee/worker_bee |
20 changes: 20 additions & 0 deletions
20
packages/auth/amplify_auth_cognito_test/pubspec_overrides.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated with `aft`. Do not modify by hand or check into source control. | ||
dependency_overrides: | ||
amplify_auth_cognito_dart: | ||
path: ../amplify_auth_cognito_dart | ||
amplify_core: | ||
path: ../../amplify_core | ||
amplify_lints: | ||
path: ../../amplify_lints | ||
amplify_secure_storage_dart: | ||
path: ../../secure_storage/amplify_secure_storage_dart | ||
aws_common: | ||
path: ../../aws_common | ||
aws_signature_v4: | ||
path: ../../aws_signature_v4 | ||
smithy: | ||
path: ../../smithy/smithy | ||
smithy_aws: | ||
path: ../../smithy/smithy_aws | ||
worker_bee: | ||
path: ../../worker_bee/worker_bee |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this work with Edge, like Flutter tests? If so, might be worth noting somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, I forget about edge 😂 I'll see if we can get it running on windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's not supported yet, unfortunately: dart-lang/test#1142. The Flutter team jumped through some hoops to get it to work (flutter/engine#15641) and I'm not sure if that effort is worth it right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sounds good