Skip to content

Commit

Permalink
Update tests to fix duplicate name issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle committed Oct 4, 2023
1 parent 513e6c8 commit 7453bb8
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 118 deletions.
227 changes: 127 additions & 100 deletions .github/composite_actions/log_cw_metric/dist/main.cjs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .github/composite_actions/log_cw_metric/dist/main.cjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/e2e_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
type: boolean

jobs:
e2e-test:
e2e-android-test:
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
type: boolean

jobs:
e2e-test:
e2e-test-ios:
runs-on: macos-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
type: boolean

jobs:
e2e-test:
e2e-test-linux:
runs-on:
labels: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
type: boolean

jobs:
e2e-test:
e2e-test-web:
runs-on:
labels: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
type: boolean

jobs:
e2e-test:
e2e-test-windows:
runs-on:
labels: windows-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/flutter_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: boolean

jobs:
test:
test-flutter_android:
name: Build and Test
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

test-type: unit
working-directory: ${{ inputs.working-directory }}
working-directory: ${{ inputs.example-directory }}

framework: flutter
flutter-dart-channel: ${{ matrix.channel }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/flutter_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: boolean

jobs:
test:
test-flutter_ios:
name: Build and Test
runs-on: macos-latest-xl
timeout-minutes: 30
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

test-type: unit
working-directory: ${{ inputs.working-directory }}
working-directory: ${{ inputs.example-directory }}

framework: flutter
flutter-dart-channel: ${{ matrix.channel }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flutter_vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
type: boolean

jobs:
test:
test-flutter_vm:
name: Test
runs-on: ${{ inputs.has-goldens && 'macos-latest' || 'ubuntu-latest' }}
timeout-minutes: 60
Expand Down
10 changes: 7 additions & 3 deletions actions/bin/log_cw_metric.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Future<void> logMetric() async {

final matrixValues = parseMatrixInput(matrixRawInput);
final jobIdentifier =
'${github.context.workflow} / ${github.context.job} ${matrixValues == null ? '' : '($matrixValues)'}';
'${github.context.job} ${matrixValues == null ? '' : '($matrixValues)'}';

core.info('Job identifier: $jobIdentifier');

Expand Down Expand Up @@ -164,6 +164,8 @@ Future<String> getFailingStep(
String runId,
) async {
try {
jobIdentifier = jobIdentifier.toLowerCase();

final headers = {
'Authorization': 'token $githubToken',
'Accept': 'application/vnd.github.v3+json',
Expand All @@ -181,8 +183,10 @@ Future<String> getFailingStep(

print('response successfully parsed to a jobsList');

final matchingJob =
jobsList.jobs.firstWhere((job) => job.name.contains(jobIdentifier));
final matchingJob = jobsList.jobs.firstWhere(
(job) => job.name.toLowerCase().contains(jobIdentifier),
orElse: () => throw Exception(
'No job found matching $jobIdentifier. Ensure full workflow path run name is unique. Available jobs: ${jobsList.jobs.map((e) => e.name).join(', ')}'));
final steps = matchingJob.steps;
core.info('steps $steps');

Expand Down

0 comments on commit 7453bb8

Please sign in to comment.