From 4cc847240091c1c8f4915c6c043ca7073aee1329 Mon Sep 17 00:00:00 2001 From: darkverbito Date: Thu, 23 May 2024 13:38:36 -0500 Subject: [PATCH] Increased timeouts, added ci/cd (#10) --- .github/workflows/dart.yml | 39 +++++++++++++++++++++++++ pubspec.yaml | 3 +- test/auth_api/address_utils_test.dart | 2 ++ test/auth_api/auth_client_test.dart | 2 ++ test/auth_api/signature_test.dart | 2 ++ test/auth_api/validation_test.dart | 2 ++ test/core_api/core_test.dart | 2 ++ test/core_api/crypto_test.dart | 2 ++ test/core_api/echo_test.dart | 2 ++ test/core_api/pairing_store_test.dart | 2 ++ test/core_api/pairing_test.dart | 2 ++ test/core_api/relay_auth_test.dart | 2 ++ test/core_api/relay_client_test.dart | 2 ++ test/core_api/store_test.dart | 2 ++ test/shared/namespace_utils_test.dart | 2 ++ test/shared/uri_parse_test.dart | 2 ++ test/sign_api/sign_client_test.dart | 3 ++ test/sign_api/sign_engine_test.dart | 3 ++ test/sign_api/store_test.dart | 2 ++ test/sign_api/validation_test.dart | 2 ++ test/sign_api/web3wallet_sign_test.dart | 3 ++ test/web3wallet/web3wallet_test.dart | 2 ++ 22 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/dart.yml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml new file mode 100644 index 0000000..ca71937 --- /dev/null +++ b/.github/workflows/dart.yml @@ -0,0 +1,39 @@ +name: Dart + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + # Note: This workflow uses the latest stable version of the Dart SDK. + # You can specify other versions if desired, see documentation here: + # https://github.com/dart-lang/setup-dart/blob/main/README.md + # - uses: dart-lang/setup-dart@v1 + - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 + with: + sdk: 3.3.4 + + - name: Install dependencies + run: dart pub get + + # Uncomment this step to verify the use of 'dart format' on each commit. + # - name: Verify formatting + # run: dart format --output=none --set-exit-if-changed . + + # Consider passing '--fatal-infos' for slightly stricter analysis. + - name: Analyze project source + run: dart analyze + + # Your project will need to have tests in test/ and a dependency on + # package:test for this step to succeed. Note that Flutter projects will + # want to change this to 'flutter test'. + - name: Run tests + run: export PROJECT_ID=irulast_wc_$RANDOM && dart test \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 1f13327..5e095df 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 2.1.8 repository: https://github.com/irulast/WalletConnectDartV2_i environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=3.3.4 <3.4.0' dependencies: web_socket_channel: ^2.4.5 @@ -16,7 +16,6 @@ dependencies: x25519: ^0.1.1 bs58: ^1.0.2 ed25519_edwards: ^0.3.1 - # json_rpc_2: ^3.0.2 event: ^2.1.2 stream_channel: ^2.1.0 universal_io: ^2.0.4 diff --git a/test/auth_api/address_utils_test.dart b/test/auth_api/address_utils_test.dart index 3f9a685..963a9f0 100644 --- a/test/auth_api/address_utils_test.dart +++ b/test/auth_api/address_utils_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'package:test/test.dart'; import 'package:walletconnect_dart_v2_i/walletconnect_dart_v2_i.dart'; diff --git a/test/auth_api/auth_client_test.dart b/test/auth_api/auth_client_test.dart index af27456..8fb9274 100644 --- a/test/auth_api/auth_client_test.dart +++ b/test/auth_api/auth_client_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 360)) + import 'dart:async'; import 'dart:typed_data'; diff --git a/test/auth_api/signature_test.dart b/test/auth_api/signature_test.dart index fb8a922..9deb1a1 100644 --- a/test/auth_api/signature_test.dart +++ b/test/auth_api/signature_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'dart:convert'; import 'package:convert/convert.dart'; diff --git a/test/auth_api/validation_test.dart b/test/auth_api/validation_test.dart index 8b8f877..2d3a531 100644 --- a/test/auth_api/validation_test.dart +++ b/test/auth_api/validation_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'package:test/test.dart'; import 'package:walletconnect_dart_v2_i/apis/auth_api/utils/auth_constants.dart'; import 'package:walletconnect_dart_v2_i/walletconnect_dart_v2_i.dart'; diff --git a/test/core_api/core_test.dart b/test/core_api/core_test.dart index a26d439..4bf8a1c 100644 --- a/test/core_api/core_test.dart +++ b/test/core_api/core_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'package:mockito/mockito.dart'; import 'package:test/test.dart'; import 'package:walletconnect_dart_v2_i/apis/core/relay_client/relay_client.dart'; diff --git a/test/core_api/crypto_test.dart b/test/core_api/crypto_test.dart index 559ff00..ba47de0 100644 --- a/test/core_api/crypto_test.dart +++ b/test/core_api/crypto_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'dart:convert'; import 'package:convert/convert.dart'; diff --git a/test/core_api/echo_test.dart b/test/core_api/echo_test.dart index 8621e25..96970ea 100644 --- a/test/core_api/echo_test.dart +++ b/test/core_api/echo_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'package:http/http.dart'; import 'package:mockito/mockito.dart'; import 'package:test/test.dart'; diff --git a/test/core_api/pairing_store_test.dart b/test/core_api/pairing_store_test.dart index 1a03569..b6437f3 100644 --- a/test/core_api/pairing_store_test.dart +++ b/test/core_api/pairing_store_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'package:test/test.dart'; import 'package:walletconnect_dart_v2_i/apis/core/core.dart'; import 'package:walletconnect_dart_v2_i/apis/core/i_core.dart'; diff --git a/test/core_api/pairing_test.dart b/test/core_api/pairing_test.dart index 62c3e0c..e3ce7fd 100644 --- a/test/core_api/pairing_test.dart +++ b/test/core_api/pairing_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'dart:async'; import 'package:test/test.dart'; diff --git a/test/core_api/relay_auth_test.dart b/test/core_api/relay_auth_test.dart index 0899c2c..fe2dbb3 100644 --- a/test/core_api/relay_auth_test.dart +++ b/test/core_api/relay_auth_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'dart:convert'; import 'dart:typed_data'; diff --git a/test/core_api/relay_client_test.dart b/test/core_api/relay_client_test.dart index de208b8..fbc9711 100644 --- a/test/core_api/relay_client_test.dart +++ b/test/core_api/relay_client_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'dart:async'; import 'package:http/http.dart'; diff --git a/test/core_api/store_test.dart b/test/core_api/store_test.dart index 02ad1dc..aabeff0 100644 --- a/test/core_api/store_test.dart +++ b/test/core_api/store_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'dart:async'; import 'package:test/test.dart'; diff --git a/test/shared/namespace_utils_test.dart b/test/shared/namespace_utils_test.dart index 2882c5e..b5da9d0 100644 --- a/test/shared/namespace_utils_test.dart +++ b/test/shared/namespace_utils_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'package:test/test.dart'; import 'package:walletconnect_dart_v2_i/apis/sign_api/utils/sign_api_validator_utils.dart'; import 'package:walletconnect_dart_v2_i/walletconnect_dart_v2_i.dart'; diff --git a/test/shared/uri_parse_test.dart b/test/shared/uri_parse_test.dart index 9d00022..608736e 100644 --- a/test/shared/uri_parse_test.dart +++ b/test/shared/uri_parse_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'package:test/test.dart'; import 'package:walletconnect_dart_v2_i/walletconnect_dart_v2_i.dart'; diff --git a/test/sign_api/sign_client_test.dart b/test/sign_api/sign_client_test.dart index f0b2787..012f880 100644 --- a/test/sign_api/sign_client_test.dart +++ b/test/sign_api/sign_client_test.dart @@ -1,4 +1,7 @@ +@Timeout(Duration(seconds: 360)) + import 'package:logger/logger.dart'; +import 'package:test/test.dart'; import 'package:walletconnect_dart_v2_i/walletconnect_dart_v2_i.dart'; import '../shared/shared_test_utils.dart'; diff --git a/test/sign_api/sign_engine_test.dart b/test/sign_api/sign_engine_test.dart index 6b2312a..6709f5e 100644 --- a/test/sign_api/sign_engine_test.dart +++ b/test/sign_api/sign_engine_test.dart @@ -1,3 +1,6 @@ +@Timeout(Duration(seconds: 360)) + +import 'package:test/test.dart'; import 'package:walletconnect_dart_v2_i/apis/core/store/generic_store.dart'; import 'package:walletconnect_dart_v2_i/apis/sign_api/sign_engine.dart'; import 'package:walletconnect_dart_v2_i/walletconnect_dart_v2_i.dart'; diff --git a/test/sign_api/store_test.dart b/test/sign_api/store_test.dart index 22b605f..c4ee8a9 100644 --- a/test/sign_api/store_test.dart +++ b/test/sign_api/store_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'dart:async'; import 'package:test/test.dart'; diff --git a/test/sign_api/validation_test.dart b/test/sign_api/validation_test.dart index 4d353c4..5fb38c4 100644 --- a/test/sign_api/validation_test.dart +++ b/test/sign_api/validation_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'package:test/test.dart'; import 'package:walletconnect_dart_v2_i/walletconnect_dart_v2_i.dart'; import 'package:walletconnect_dart_v2_i/apis/sign_api/utils/sign_api_validator_utils.dart'; diff --git a/test/sign_api/web3wallet_sign_test.dart b/test/sign_api/web3wallet_sign_test.dart index 40e2d91..5daeec2 100644 --- a/test/sign_api/web3wallet_sign_test.dart +++ b/test/sign_api/web3wallet_sign_test.dart @@ -1,3 +1,6 @@ +@Timeout(Duration(seconds: 360)) + +import 'package:test/test.dart'; import 'package:walletconnect_dart_v2_i/walletconnect_dart_v2_i.dart'; import '../shared/shared_test_utils.dart'; diff --git a/test/web3wallet/web3wallet_test.dart b/test/web3wallet/web3wallet_test.dart index 44d02fc..dd86090 100644 --- a/test/web3wallet/web3wallet_test.dart +++ b/test/web3wallet/web3wallet_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 90)) + import 'dart:async'; import 'package:test/test.dart';