From 870556e7168df53f148a9164d68d6f5c6b88174d Mon Sep 17 00:00:00 2001 From: guidezpl <6655696+guidezpl@users.noreply.github.com> Date: Wed, 18 May 2022 08:27:09 +0200 Subject: [PATCH] Use main within repo --- .github/workflows/build.yml | 2 +- .github/workflows/scorecards-analysis.yml | 2 +- .github/workflows/test.yml | 2 +- README.md | 9 ++++----- test_goldens/README.md | 21 +++++++++++---------- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0319b38430..59f44a2254 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Builds on: push: branches: - - master + - main pull_request: jobs: diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index d85c078d1f..6b63f1e6be 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -3,7 +3,7 @@ on: # Only the default branch is supported. branch_protection_rule: push: - branches: [ master ] + branches: [main] # Declare default permissions as read only. permissions: read-all diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc89bd43ad..c145d64680 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: Tests on: push: branches: - - master + - main pull_request: jobs: diff --git a/README.md b/README.md index 40492c62d3..c2bda613c9 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ These include: - Linux ([.tar.gz][latest release]) - Windows ([.zip][latest release]) -One can run the gallery locally for any of these platforms. For desktop platforms, +One can run the gallery locally for any of these platforms. For desktop platforms, please see the [Flutter docs](https://docs.flutter.dev/desktop) for the latest requirements. @@ -113,15 +113,15 @@ more details. which part to increment. The version number after the `+` should also be incremented. For example `1.2.3+010203` with a patch should become `1.2.4+010204`. -2. **Staging**: After the version bump PR is merged, push a new version tag to master. +2. **Staging**: After the version bump PR is merged, push a new version tag to main. ```bash -git pull upstream master +git pull upstream main git tag v1.2.4 # note the v git push upstream v1.2.4 ``` -This will trigger a set of GitHub Actions [workflows](https://github.com/flutter/gallery/tree/master/.github/workflows) that will: +This will trigger a set of GitHub Actions [workflows](https://github.com/flutter/gallery/tree/main/.github/workflows) that will: - Draft a [GitHub release](<(https://github.com/flutter/gallery/releases)>) with automatically generated release notes and packaged builds (.apk, macOS, Windows, and Linux) - Deploy the gallery to the Firebase hosted [staging site](https://gallery-staging-flutter-dev.web.app/) @@ -143,5 +143,4 @@ The gallery has its own set of unit and integration tests. Flutter itself also u - `flutter analyze`: https://github.com/flutter/tests/blob/master/registry/flutter_gallery.test - DeviceLab tests: https://github.com/flutter/flutter/blob/master/dev/devicelab/lib/versions/gallery.dart - [latest release]: https://github.com/flutter/gallery/releases/latest diff --git a/test_goldens/README.md b/test_goldens/README.md index 8ce4bc56be..7cb989ce6b 100644 --- a/test_goldens/README.md +++ b/test_goldens/README.md @@ -1,20 +1,22 @@ # Golden tests + Golden tests, also called screenshot tests, let's you write tests to easily find UI regressions. It compares the UI to saved golden screenshots, and if there is a pixel difference the tests will fail. It gives us confidence that code changes does not cause UI regressions. ## Updating goldens + An expected change to the UI will also cause the golden tests to fail. If this is unintended, you will need to change your code to prevent the UI change. If it was intended, you will then need to update the goldens by running the following command on your macOS machine: + ```bash flutter test --update-goldens test_goldens ``` -Due to slight [differences]( -https://github.com/flutter/flutter/issues/36667#issuecomment-521335243) +Due to slight [differences](https://github.com/flutter/flutter/issues/36667#issuecomment-521335243) in rendering across platforms, mostly around text, the tests will only be run on a macOS machine on Github Actions. This means that if you update the tests on a Linux or Windows machine the golden tests will not pass on Github Actions. @@ -22,22 +24,21 @@ Instead you are recommended to download the goldens directly from the failed Github Actions job, and use those inside of your branch. You can find the goldens under Artifacts in the top menu inside of the failed -Github Actions job. It will include the master image, your test image and the +Github Actions job. It will include the golden image, your test image and the difference. -![Where to download the golden artifacts]( -https://user-images.githubusercontent.com/1770678/80202787-70f1de80-8626-11ea-9d98-58ac72f67479.png) +![Where to download the golden artifacts](https://user-images.githubusercontent.com/1770678/80202787-70f1de80-8626-11ea-9d98-58ac72f67479.png) ## Loading fonts in golden tests -In Flutter widget tests the font used is the ['Ahem']( -https://www.w3.org/Style/CSS/Test/Fonts/Ahem/README)-font. It was built to help + +In Flutter widget tests the font used is the ['Ahem'](https://www.w3.org/Style/CSS/Test/Fonts/Ahem/README)-font. It was built to help test writers develop predictable tests, by most glyphs being a square box. To be able to test the rendering of our icons and fonts, the actual fonts are -loaded before the test suites run. See [font_loader.dart]( -testing/font_loader.dart). +loaded before the test suites run. See [font_loader.dart](testing/font_loader.dart). ## Shadows in golden tests + In the golden tests the shadows are opaqued, to [reduce the likelihood of golden file tests being flaky](https://api.flutter.dev/flutter/flutter_test/LiveTestWidgetsFlutterBinding/disableShadows.html). A side effect of this is that we are not testing the exact rendering of shadows -inside of the goldens. \ No newline at end of file +inside of the goldens.