Skip to content

feat: create smoke tests#1045

Open
tomasz-trela wants to merge 31 commits intomainfrom
chore/setup-patrol
Open

feat: create smoke tests#1045
tomasz-trela wants to merge 31 commits intomainfrom
chore/setup-patrol

Conversation

@tomasz-trela
Copy link
Member

@tomasz-trela tomasz-trela commented Mar 1, 2026

Important

Introduces smoke tests and updates CI workflow for iOS integration testing, with code adjustments for test support.

  • CI Workflow:
    • Updates .github/workflows/flutter_ci.yaml to include iOS integration tests using a simulator.
    • Adds steps to install git-crypt and unlock secrets for testing.
  • Smoke Tests:
    • Adds integration_test/smoke_test.dart with multiple end-to-end tests for different views like HomeView, BuildingsView, etc.
    • Uses mock repositories for PreferredLanguageRepository, BranchRepository, and LocalChangelogRepository.
  • Code Adjustments:
    • Adds verticalScrollableKey to MyAppConfig in ui_config.dart for consistent scrollable widget identification.
    • Adds AwesomeDioInterceptor to dio_client.dart for enhanced logging in debug mode.
    • Ensures ref.mounted checks in departments_repository.dart and pop_scope_coordinator.dart to prevent errors during unmounted state.

This description was created by Ellipsis for fde3493. You can customize this summary. It will automatically update as commits are pushed.

@tomasz-trela tomasz-trela self-assigned this Mar 1, 2026
@simon-the-shark simon-the-shark force-pushed the main branch 3 times, most recently from 0806722 to d0a34bd Compare March 1, 2026 23:31
@tomasz-trela tomasz-trela marked this pull request as ready for review March 2, 2026 14:25
@tomasz-trela
Copy link
Member Author

There is failing check because parkings are down

@tomasz-trela
Copy link
Member Author

But yesterday test was passing

Copy link
Member

@simon-the-shark simon-the-shark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job, good job. if you don't want to expand tests now, we can add all this as followup tasks on the board


steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why v4?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

Comment on lines +62 to +81
- name: Pre-build iOS Integration Test App
run: flutter build ios --debug --no-codesign --simulator

- name: Boot iOS Simulator
run: |
set +e
DEVICE_UUID=$(xcrun simctl list devices available | grep "iPhone" | head -n 1 | awk -F'[()]' '{print $2}')
set -e

if [ -z "$DEVICE_UUID" ]; then
exit 1
fi

xcrun simctl boot "$DEVICE_UUID" || true
xcrun simctl bootstatus "$DEVICE_UUID"
echo "SIMULATOR_ID=$DEVICE_UUID" >> $GITHUB_ENV

- name: Run Integration Tests on iOS Simulator
run: flutter test integration_test/smoke_test.dart -d "$SIMULATOR_ID" --timeout=30m
timeout-minutes: 45 No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it's taking 20+ minutes, let's separate all-checks from integrations-tests maybe so it can run in parallel (can be same file and workflow, just separate jobs)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it's good idea

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about AboutUsView, CalendarView, NewsListView, SksMenuScreen, SksFavouriteDishesView, SettingsView :))) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good idea for next task

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's also obv digital guide but no need to do it now, you can add it to backlog as followup task for someone in the future

Comment on lines +172 to +189
testWidgets("DeparmentsView smoke test", (tester) async {
await app.main(overrides: createPopupProviderOverrides());
await tester.pumpAndSettle();

await tapNavButton(tester, NavBarEnum.navigation);
await tester.pump(const Duration(seconds: 3)); // there pumpAndSettle never ends on NavigationView

final navButton = find.byKey(NavigationTabViewConfig.departments);
await tester.tap(navButton);

await tester.pumpAndSettle();

final errorFinder = find.byType(MyErrorWidget);
final scrollableFinder = find.byKey(MyAppConfig.verticalScrollableKey);
await scrollAndFailIfFound(tester: tester, scrollableFinder: scrollableFinder, targetFinder: errorFinder);
await tester.pumpAndSettle();
await tester.pump(const Duration(seconds: 3));
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the list views, we could consider also clicking on a random item on the list and seeing if it hadn't crashed as well. wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good idea for next task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants