Skip to content

Make codesign.dart integration test easier to run locally - #50289

Merged
christopherfujino merged 4 commits into
flutter:masterfrom
chris-forks:update-codesign-check
Feb 7, 2020
Merged

christopherfujino merged 4 commits into
flutter:masterfrom
chris-forks:update-codesign-check

Conversation

@christopherfujino

Copy link
Copy Markdown
Contributor

Add two checks before running test to make this script more user-friendly to run locally from the command line.

  1. Check platform is macOS.
  2. Check the cache is up to date.

@fluttergithubbot fluttergithubbot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Feb 6, 2020
@fluttergithubbot

Copy link
Copy Markdown
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@christopherfujino

Copy link
Copy Markdown
Contributor Author

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

This change is a test.

Comment thread dev/bots/codesign.dart
'find',
<String>[
cacheDirectory,
rootDirectory,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't we default this to something non-null? Or make it a non-optional parameter and assert it's not null?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good catch. i had a fallback default, forget why I deleted it...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread dev/bots/codesign.dart Outdated

for (final String binaryPath in findBinaryPaths()) {
if (!Platform.isMacOS) {
print('Warning! This script only works on macOS, as it requires Xcode.');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

uber-nit: on CI, this might read strangely if you thought it was running on macOS, and it might be helpful to just print out Platform.operatingSystem in here.

Ideally we'd also want to make sure the binaries we need (e.g. codesign) are on the path, but it's probably fine to skip that for this script.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated error message.

@dnfield dnfield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with nits.

Comment thread dev/bots/codesign.dart
final String flutterRepoRoot = path.normalize(path.join(path.dirname(Platform.script.path), '..', '..'));
return path.normalize(path.join(flutterRepoRoot, 'bin', 'cache'));
}
String get repoRoot => path.normalize(path.join(path.dirname(Platform.script.toFilePath()), '..', '..'));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the previous of this script actually failed on cirrus because the space in the script file path was escaped. changing Platform.script.path -> Platform.script.toFilePath() fixed that.

@dnfield dnfield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@christopherfujino
christopherfujino merged commit b65f421 into flutter:master Feb 7, 2020
@christopherfujino
christopherfujino deleted the update-codesign-check branch February 7, 2020 22:34
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants