From ad7c7ae96b68fe4a92edc80fc81350e348a0a57d Mon Sep 17 00:00:00 2001 From: schwartz-concordium <132270889+schwartz-concordium@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:00:34 +0100 Subject: [PATCH] try only clean up on all test --- .github/workflows/integration-tests.yml | 2 +- .../secret_storage/secret_storage_test.dart | 34 ++++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 969226c..f475c39 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -14,7 +14,7 @@ env: flutter_version: 3.13.6 iphone_model: iPhone 8 android_profile: Nexus 6 - android_api_level: 31 + android_api_level: 32 android_target: google_apis jobs: diff --git a/integration_test/secret_storage/secret_storage_test.dart b/integration_test/secret_storage/secret_storage_test.dart index 07e7df9..500ebfe 100644 --- a/integration_test/secret_storage/secret_storage_test.dart +++ b/integration_test/secret_storage/secret_storage_test.dart @@ -29,7 +29,7 @@ void main() { try { // [Hive.deleteFromDisk] doesn't close by itself on // web https://github.com/isar/hive/pull/734. - await Hive.deleteFromDisk().timeout(const Duration(seconds: 2)); + await Hive.deleteFromDisk().timeout(const Duration(seconds: 1)); } catch (_) {} } @@ -38,25 +38,41 @@ void main() { await mobileStorage.deleteAll(); } + // setUpAll(() async { + // await Hive.initFlutter(); + // storage = await SecretStorageProviderFactory.create(); + // }); + + // tearDown(() async { + // if (kIsWeb) { + // await clearHiveBox(); + // } else { + // await clearMobileStorage(); + // } + // }); + + // tearDownAll(() async { + // if (kIsWeb) { + // await deleteHiveFromDisk(); + // } + // }); + setUpAll(() async { await Hive.initFlutter(); - storage = await SecretStorageProviderFactory.create(); }); + setUp(() async { + storage = await SecretStorageProviderFactory.create(); + }); + tearDown(() async { if (kIsWeb) { - await clearHiveBox(); + await deleteHiveFromDisk(); } else { await clearMobileStorage(); } }); - tearDownAll(() async { - if (kIsWeb) { - await deleteHiveFromDisk(); - } - }); - testWidgets("When set, read and delete from storage, then update storage correctly", (widgetTester) async { // Arrange await storage.setPassword("password");