Skip to content

Test all repo configs#1149

Merged
fluttergithubbot merged 6 commits intoflutter:masterfrom
christopherfujino:test-all-repo-configs
Apr 8, 2021
Merged

Test all repo configs#1149
fluttergithubbot merged 6 commits intoflutter:masterfrom
christopherfujino:test-all-repo-configs

Conversation

@christopherfujino
Copy link
Contributor

set -euxo pipefail

echo "Running config tests for all repos"
pushd app_dart > /dev/null
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI this path cannot be found

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, i think i know how to fix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

const Repo({
@required this.name,
@required this.remoteUrl,
this.ref = 'master',
Copy link
Contributor

Choose a reason for hiding this comment

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

Future work: How should we collect the branches that we also validate on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these can be implemented as separate entries in the allRepos list.


final io.ProcessResult result = io.Process.runSync(
'git',
<String>['clone', '-b', repo.ref, '--', repo.remoteUrl, dir.path],
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we only care about .ci.yaml, should we just download that file instead of cloning the entire repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, that's a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

pushd "$1" > /dev/null
flutter clean
pub get
dart pub get
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the officially recommended way to do this now.


echo "############# files that require formatting ###########"
dartfmt -n --line-length=120 --set-exit-if-changed .
dartfmt --dry-run --line-length=120 --set-exit-if-changed .
Copy link
Contributor Author

Choose a reason for hiding this comment

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

-n == --dry-run.

if grep -lq "build_runner" pubspec.yaml; then
echo "############# build ###########"
pub run build_runner build --delete-conflicting-outputs
dart run build_runner build --delete-conflicting-outputs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ditto, this is preferred over pub run

@christopherfujino
Copy link
Contributor Author

updated and fixed tests, PTAL @CaseyHillers

// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:appengine/appengine.dart';
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: package:logging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what's package:logging? I don't see it in the pubspec.yaml

Copy link
Contributor

Choose a reason for hiding this comment

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

It's already a transitive dependency, so feel free to add it as a dependency. We shouldn't rely on the various gcloud libraries (when possible) as they import dart:mirrors which can't run in Flutter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm reusing the remoteFileContent() method, which requires a Logging instance, as defined by package:appengine: https://pub.dev/documentation/appengine/latest/appengine/Logging-class.html

Future<void> main() async {
for (final String configFile in configFiles) {
test('validate config file of $configFile', () async {
final String configContent = await remoteFileContent(
Copy link
Contributor

Choose a reason for hiding this comment

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

@CaseyHillers you're going to run into merge conflicts with this on #1150

Copy link
Contributor

@CaseyHillers CaseyHillers left a comment

Choose a reason for hiding this comment

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

LGTM!

@christopherfujino christopherfujino added the waiting for tree to go green Merge PR when tree becomes green via fluttergithubbot label Apr 8, 2021
@fluttergithubbot fluttergithubbot merged commit e218a23 into flutter:master Apr 8, 2021
@christopherfujino christopherfujino deleted the test-all-repo-configs branch April 8, 2021 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for tree to go green Merge PR when tree becomes green via fluttergithubbot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants