Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

CircleCI config overhaul, instrumentation tests & screenshot automation (EXPOSUREAPP-4480,DEV) #2160

Merged

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Jan 19, 2021

@mtwalli, @AlexanderAlferov and me overhauled the CircleCI config, added instrumentation testing and automatic screenshots.

Highlights:

  • Refactored the config (yes you can refactor YAML 😵) to make use more use of re-usable functions
  • Use larger instances for faster test execution
  • Adjusted gradle/JVM options to improve performance and use larger instances better
  • Run instrumentation tests via macOS CircleCI executor
  • Run automated screenshot routine via fastlane when a new release candidate is build
  • Improved caching behavior
  • Split works for better job restart and improved dependencies between tasks
  • Renamed tasks and work flows to be easier to understand

We tried Firebase Testlab, but it was not working out, due to lack of control over the whole process (more of a black box) and inability to use fastlane with it. There were also issues with our mocking library which could fail on newer API emulators if not run on x86_64 architecture emulators, and firebase testlab doesn't allow us to enforce it.

Because we previously didn't run instrumentation tests via CI, a few tests fell into disarray and will need fixing. The current config setup is already a huge improvement over the previous config and I think should merge it despite the failing instrumentation tests. Until we enforce the check to pass for branches, there should be no issue. A follow up PR can then be made stress free to fix the failing tests.

This was initially targeted for 1.12, but as this will require adjusting the branch restrictions, it would make sense to merge this into 1.11, we share the same branch restrictions between all branches. Then the only problematic branch would be 1.10.x which will soon be superseeded by 1.11.x.

Once the config is merged I will change the restrictions and all open PRs will have to pull the new config to run the correct tests.

@d4rken d4rken added the maintainers Tag pull requests created by maintainers label Jan 19, 2021
@d4rken d4rken added this to the 1.11.0 milestone Jan 19, 2021
.circleci/config.yml Outdated Show resolved Hide resolved
@d4rken
Copy link
Member Author

d4rken commented Jan 19, 2021

  • The screenshot job takes quite long ~50-100 minutes, only executed on releases though.
  • Instrumentation test take around 17min (once cached). Normal tests are around 10 min. So this adds 7 min to our test pipeline time, but I think that is just the price to pay and will be well worth it. Maybe someone has a good idea on how we can further speed this up? The alternative would be to either live with it, or make the test result non-blocking... 🤔

@d4rken d4rken changed the title CircleCI config overhaul & instrumentation tests (EXPOSUREAPP-4480,DEV) CircleCI config overhaul, instrumentation tests & screenshot automation (EXPOSUREAPP-4480,DEV) Jan 19, 2021
.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
@AlexanderAlferov AlexanderAlferov self-assigned this Jan 20, 2021
@d4rken d4rken added the author merge PR to be merged by author label Jan 20, 2021
@kaddaSz
Copy link
Contributor

kaddaSz commented Jan 20, 2021

Could you also Zip the ScreenShots? So I could just donwload the zip. The idea is, to add this zip later also to the release notes.
The same would make sence to the test results I guess.

@d4rken
Copy link
Member Author

d4rken commented Jan 20, 2021

This would be merged after we have finished the statistics stuff so there is no delay due to pipeline issues.

@d4rken
Copy link
Member Author

d4rken commented Jan 20, 2021

Could you also Zip the ScreenShots? So I could just donwload the zip. The idea is, to add this zip later also to the release notes.

I think so. Will check. We could also link the artifacts on CircleCI directly, though the link will probably break after a few weeks? CircleCI artifact storage times out at some time.

The same would make sense to the test results I guess.

What do you mean by that?

@kaddaSz
Copy link
Contributor

kaddaSz commented Jan 20, 2021

The same would make sense to the test results I guess.

What do you mean by that?

https://app.circleci.com/pipelines/github/corona-warn-app/cwa-app-android/8541/workflows/2a8cd323-f037-4369-818a-eaf96ad45373/jobs/43183/artifacts

There are also a lot of artifacts, which you maybe could zip? I could use these results for our internal reporting, but it would be easier to just download a zip.

@d4rken
Copy link
Member Author

d4rken commented Jan 20, 2021

Screenshots, Instrumentation tests (release), unit tests (release) are now uploaded as .zip too.

Copy link
Contributor

@AlexanderAlferov AlexanderAlferov left a comment

Choose a reason for hiding this comment

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

LGTM

Zip and upload test html reports instead of xml files.
…into feature/4480-circle-ci-overhaul-instrumentation-emulator-performance
@sonarcloud
Copy link

sonarcloud bot commented Jan 20, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@d4rken d4rken merged commit e12aa6d into release/1.11.x Jan 20, 2021
@d4rken d4rken deleted the feature/4480-circle-ci-overhaul-instrumentation-tests branch January 20, 2021 16:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author merge PR to be merged by author maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants