Skip to content

feat: adding shorebird specific tests #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 9, 2024

Conversation

erickzanardo
Copy link

We do a couple of customizations in the flutter framework build pipeline. Like manipulating the shorebird.yaml that is bundled in the build flutter_assets folder when there is a flavor, or when a public key for patch signing is provided through an environment variable.

But there were no tests to assert in that behaviour.

Since the pipeline can be a bit complex, the approach proposed in this PR is to write some sort of integration tests for these customizations that we do.

These integration tests are unique to Shorebird, the repository already include a folder called integration_test, but AFAIK, that folder is about flutter integration test features, so the choice were to create a new shorebird_test package, which is intended to house tests of behaviours included in the framework that are related to the mentioned customizations.

import 'package:meta/meta.dart';
import 'package:test/test.dart';

File get _flutterBinaryFile => File(

Choose a reason for hiding this comment

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

Doc comments throughout this file would be useful. Here: "this assumes we're running from (path)" or similar

Comment on lines +8 to +10
dependencies:
archive: ^3.5.1
path: ^1.9.0
Copy link

Choose a reason for hiding this comment

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

Do we need these dependencies?

Copy link
Author

Choose a reason for hiding this comment

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


void main() {
group('shorebird helpers', () {
testWithShorebirdProject('can build a base project',
Copy link

Choose a reason for hiding this comment

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

I wonder if we even need this test?

Copy link
Author

Choose a reason for hiding this comment

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

yeah, in theory we don't, but I kind like having basic ones like that cause it makes it easier to track down a test that broke in an "earlier" layer.

Happy to remove them if you think they just "fill up space"

Copy link

@felangel felangel left a comment

Choose a reason for hiding this comment

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

Overall lgtm just left some minor comments

erickzanardo and others added 2 commits May 7, 2024 20:24
Co-authored-by: Felix Angelov <felix@shorebird.dev>
@erickzanardo erickzanardo merged commit 159d452 into shorebird/dev May 9, 2024
4 of 7 checks passed
@erickzanardo erickzanardo deleted the feat/adding-flutter-tools-test branch May 9, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants