Skip to content

Conversation

@ribafish
Copy link
Member

  • Enabled Predictive Test Selection (PTS) by default.
  • Set the FAST PTS profile for testAndroid${version} test tasks and STANDARD profile for "regular" test task.
  • Set RELEVANT_TESTS PTS mode for PRs (pre-merge) and REMAINING_TESTS for main (post-merge) branch builds.
  • Enabled Verify Build action for all PRs, not just the ones targeting main

…sion}` tasks. Also set REMAINING_TESTS mode for `main` branch builds on CI.
Copy link
Contributor

@runningcode runningcode left a comment

Choose a reason for hiding this comment

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

I like where this is going, but I don't like the extra complexity that adding the PTS Mode adds to this already complex CI build. Is there a way we can do it without adding the extra dependency on the generate_versions_pts job?

Second thing, if we enable PTS by default, let's be sure to disable it for release jobs.

@ribafish
Copy link
Member Author

I like where this is going, but I don't like the extra complexity that adding the PTS Mode adds to this already complex CI build. Is there a way we can do it without adding the extra dependency on the generate_versions_pts job?

I don't see a different way to be honest, at least not a simpler one. This seems pretty straightforward to me though, If this run has github.ref_name as main, then it's REMAINING_TESTS, otherwise it's RELATIVE_TESTS. The only thing to note is that when a PR is opened and triggers this action, the ref_name will hold the automatically created "merge" branch, so if it's a PR, this won't be true, even if base branch is main.

Second thing, if we enable PTS by default, let's be sure to disable it for release jobs.

The way it is set up at the moment, the only way I see that wouldn't create a completely separate workflow for release jobs (which might also make sense to do tbh) is to use workflow_dispatch.inputs with default set to false and trigger it without it (by default), while still allowing to turn it on if wanted when running it manually and set it to true if it's empty (which happens when the action is started from push to main or PR)

@ribafish ribafish requested a review from runningcode August 22, 2023 09:57
-PisPTSEnabled=${{ github.event.inputs.pts_enabled }}
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }}
ORG_GRADLE_PROJECT_isPTSEnabled: ${{ github.ref_name != 'main' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to use variable here to set the remaining tests mode inline instead of having an action to set it?

something like pts.mode: if ${{ github.ref_name == 'main' }}; then 'REMAINING_TESTS'; else 'RELEVANT_TESTS' and then pass that value?

Copy link
Member Author

Choose a reason for hiding this comment

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

if statements can't be used in the ENV part of actions, but there are some tertiary workarounds, one of which I've applied. It does need to be duplicated on both test jobs though...

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for looking in to this. While there is some duplication in this solution, i prefer the simplicity of it. It also makes it easier to use as an example for customers.

* main:
  Use AGP 8.1.1 for main build
  Run tests against AGP 8.1.1

# Conflicts:
#	release/changes.md
@ribafish ribafish requested a review from runningcode August 22, 2023 15:03
@@ -1,2 +1,2 @@
- [NEW] Run tests against AGP 8.2.0-alpha16
- [NEW] Run tests against AGP 8.1.1
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this showing a diff? is there a whitespace change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think it was without the newline at the end before. It's weird though, as I resolved it to the main branch variant of it when merging..

-PisPTSEnabled=${{ github.event.inputs.pts_enabled }}
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }}
ORG_GRADLE_PROJECT_isPTSEnabled: ${{ github.ref_name != 'main' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for looking in to this. While there is some duplication in this solution, i prefer the simplicity of it. It also makes it easier to use as an example for customers.

Copy link
Contributor

@runningcode runningcode left a comment

Choose a reason for hiding this comment

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

Alright as discussed and as per the manual, Let's use remaining tests mode for all pre-release cases instead of disabling PTS for those cases.

Copy link
Contributor

@runningcode runningcode left a comment

Choose a reason for hiding this comment

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

Looks great. I like the simplicity of this approach.

run: echo "matrix=$(jq -cM '.supportedVersions | keys' src/main/resources/versions.json | sed -e 's/\./_/g' -e 's/-/_/g')" >> $GITHUB_OUTPUT
- name: debug
run: echo ${{ steps.setup-matrix.outputs.matrix }}
run: echo "matrix=${{ steps.setup-matrix.outputs.matrix }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious, why this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, it's still left from the first variant where I set the PTS mode in that job, but I still left it in as it's more verbose when looking at logs. I can remove this change if wanted.

Copy link
Contributor

Choose a reason for hiding this comment

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

let's leave it how it originally was to simplify and reduce the changeset.

@ribafish ribafish merged commit 205da69 into main Aug 29, 2023
@ribafish ribafish deleted the gk/ptsImprovements branch August 29, 2023 10:26
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.

3 participants