Skip to content

Commit f85def2

Browse files
authored
refactor: Improve test directory structure (#192)
* refactor: reorganize test directory structure * refactor: update test file paths in pubspec.yaml
1 parent 05189c6 commit f85def2

File tree

89 files changed

+2813
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2813
-133
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ jobs:
288288
flags: unittests
289289
fail_ci_if_error: false
290290

291-
test-integration:
292-
name: Test - Integration (Dart ${{ matrix.dart-version }})
291+
test-wif:
292+
name: Test - WIF Auth (Dart ${{ matrix.dart-version }})
293293
runs-on: ubuntu-latest
294294
# Skip for fork PRs — secrets are not available
295295
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -343,19 +343,19 @@ jobs:
343343
run: melos bootstrap
344344
working-directory: .
345345

346-
- name: Run integration tests
347-
run: dart test test/app/firebase_app_prod_test.dart --concurrency=1
346+
- name: Run WIF auth test
347+
run: dart test test/integration/app/firebase_app_prod_test.dart --concurrency=1
348348

349349
build:
350350
name: Build verification (Dart ${{ matrix.dart-version }})
351351
runs-on: ubuntu-latest
352-
needs: [lint, test, test-integration]
353-
# Run even if test-integration was skipped (fork PRs), but not if lint or test failed
352+
needs: [lint, test, test-wif]
353+
# Run even if test-wif was skipped (fork PRs), but not if lint or test failed
354354
if: |
355355
always() &&
356356
needs.lint.result == 'success' &&
357357
needs.test.result == 'success' &&
358-
(needs.test-integration.result == 'success' || needs.test-integration.result == 'skipped')
358+
(needs.test-wif.result == 'success' || needs.test-wif.result == 'skipped')
359359
360360
strategy:
361361
fail-fast: false

packages/dart_firebase_admin/firebase.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"functions": [
2424
{
25-
"source": "test/functions",
25+
"source": "test/fixtures/task_queue_functions",
2626
"codebase": "default",
2727
"ignore": [
2828
"node_modules",

packages/dart_firebase_admin/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ dev_dependencies:
3737
uuid: ^4.0.0
3838

3939
false_secrets:
40-
- /test/auth/jwt_test.dart
41-
- /test/client/get_id_token.js
42-
- /test/mock_service_account.dart
40+
- /test/unit/auth/jwt_test.dart
41+
- /test/fixtures/mock_service_account.dart
42+
- /test/unit/app/credential_test.dart

packages/dart_firebase_admin/test/client/get_id_token.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

packages/dart_firebase_admin/test/client/package.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/dart_firebase_admin/test/auth/util/helpers.dart renamed to packages/dart_firebase_admin/test/fixtures/auth/helpers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:dart_firebase_admin/auth.dart';
55
import 'package:dart_firebase_admin/src/app.dart';
66
import 'package:test/test.dart';
77

8-
import '../../helpers.dart';
8+
import '../helpers.dart';
99

1010
Future<void> cleanup(Auth auth) async {
1111
// Only cleanup if we're using the emulator

packages/dart_firebase_admin/test/functions/util/helpers.dart renamed to packages/dart_firebase_admin/test/fixtures/functions/helpers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'package:dart_firebase_admin/src/app.dart';
33
import 'package:googleapis_auth/auth_io.dart';
44
import 'package:test/test.dart';
55

6-
import '../../helpers.dart';
6+
import '../helpers.dart';
77

88
/// Validates that Cloud Tasks emulator environment variable is set.
99
///
File renamed without changes.
File renamed without changes.

packages/dart_firebase_admin/test/mock_service_account.dart renamed to packages/dart_firebase_admin/test/fixtures/mock_service_account.dart

File renamed without changes.

0 commit comments

Comments
 (0)