Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test coverage support to android_local_test #15840

Conversation

Bencodes
Copy link
Contributor

@Bencodes Bencodes commented Jul 8, 2022

Adding test coverage support to android_local_test.

#15827

@sgowroji sgowroji added the team-Android Issues for Android team label Jul 8, 2022
@sgowroji sgowroji added the awaiting-review PR is awaiting review from an assigned reviewer label Jul 8, 2022
@Bencodes Bencodes force-pushed the add-test-coverage-support-to-android_local_test branch 4 times, most recently from aed7f1c to 2638341 Compare July 8, 2022 23:33

# Asserts that the coverage file exists by looking at the current $TEST_log.
# The method fails if TEST_log does not contain any coverage report for a passed test.
function assert_coverage_file_exists() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps it would be prudent to assert that the contents of the coverage dat file are valid? Even asserting that there is at least 1 row in the file would be sufficient: [[ $(wc -l $coverage_file_path) -gt 0 ]] || fail "Insufficient data in coverage data file $coverage_file_path"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated with some additional test cases around coverage contents and lcov merging contents.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like there were some Windows-related failures in the latest presubmit; any idea about those?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ted-xie everything should be passing. The windows failures were build flakes.

@Bencodes Bencodes force-pushed the add-test-coverage-support-to-android_local_test branch from 1d421f7 to c7ea2f0 Compare July 15, 2022 18:43
@sofiethorsen
Copy link

@ted-xie, @lberki, @ahumesky - are there any outstanding remarks you have on this PR that would block merging? I'm currently excluding all android tests when running coverage (only collecting coverage for pure Kotlin) - it would be beneficial to be able to include the android ones too.

@Bencodes Bencodes force-pushed the add-test-coverage-support-to-android_local_test branch from c7ea2f0 to 3f10bf3 Compare January 19, 2023 20:38
@Bencodes Bencodes force-pushed the add-test-coverage-support-to-android_local_test branch from 3f10bf3 to e56b644 Compare January 27, 2023 19:01
@ted-xie
Copy link
Contributor

ted-xie commented Feb 8, 2023

@sofiethorsen thanks for pinging me. I think we should merge this in.

@ted-xie ted-xie added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Feb 8, 2023
@sgowroji sgowroji removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Feb 10, 2023
ted-xie pushed a commit to ted-xie/bazel that referenced this pull request Feb 10, 2023
Adding test coverage support to `android_local_test`.

bazelbuild#15827

Closes bazelbuild#15840.

RELNOTES: Adds coverage metric support to android_local_test
PiperOrigin-RevId: 508549884
Change-Id: I6977efa51ca1c7a6df1f776fe1a326d07989a185
hvadehra pushed a commit that referenced this pull request Feb 14, 2023
Adding test coverage support to `android_local_test`.

#15827

Closes #15840.

RELNOTES: Adds coverage metric support to android_local_test
PiperOrigin-RevId: 508549884
Change-Id: I6977efa51ca1c7a6df1f776fe1a326d07989a185
ted-xie pushed a commit to ted-xie/bazel that referenced this pull request Feb 23, 2023
Adding test coverage support to `android_local_test`.

bazelbuild#15827

Closes bazelbuild#15840.

RELNOTES: Adds coverage metric support to android_local_test
PiperOrigin-RevId: 508549884
Change-Id: I6977efa51ca1c7a6df1f776fe1a326d07989a185
@keertk
Copy link
Member

keertk commented Feb 28, 2023

@bazel-io fork 6.1.0

ted-xie pushed a commit to ted-xie/bazel that referenced this pull request Mar 1, 2023
Adding test coverage support to `android_local_test`.

bazelbuild#15827

Closes bazelbuild#15840.

RELNOTES: Adds coverage metric support to android_local_test
PiperOrigin-RevId: 508549884
Change-Id: I6977efa51ca1c7a6df1f776fe1a326d07989a185
ted-xie pushed a commit to ted-xie/bazel that referenced this pull request Mar 1, 2023
Adding test coverage support to `android_local_test`.

bazelbuild#15827

Closes bazelbuild#15840.

RELNOTES: Adds coverage metric support to android_local_test
PiperOrigin-RevId: 508549884
Change-Id: I6977efa51ca1c7a6df1f776fe1a326d07989a185
@Bencodes Bencodes deleted the add-test-coverage-support-to-android_local_test branch March 6, 2023 18:18
ted-xie pushed a commit to ted-xie/bazel that referenced this pull request Mar 13, 2023
Adding test coverage support to `android_local_test`.

bazelbuild#15827

Closes bazelbuild#15840.

RELNOTES: Adds coverage metric support to android_local_test
PiperOrigin-RevId: 508549884
Change-Id: I6977efa51ca1c7a6df1f776fe1a326d07989a185
ShreeM01 added a commit that referenced this pull request Mar 13, 2023
* Propagate runfiles for singlejar.

Since the singlejar toolchain attribute is currently defined as a single file and carried around as an Artifact instead of a FilesToRunProvider, it's not possible to implement it as a wrapper script that dispatches to an actual implementation somewhere in its runfiles. This would be useful to experiment with cross-platform action sharing.

PiperOrigin-RevId: 492487124
Change-Id: Ib0f80314eae09bd865b3f31a4180bf068833cdf4

* Add test coverage support to android_local_test

Adding test coverage support to `android_local_test`.

#15827

Closes #15840.

RELNOTES: Adds coverage metric support to android_local_test
PiperOrigin-RevId: 508549884
Change-Id: I6977efa51ca1c7a6df1f776fe1a326d07989a185

---------

Co-authored-by: Googler <tjgq@google.com>
Co-authored-by: Benjamin Lee <ben@ben.cm>
Co-authored-by: kshyanashree <109167932+kshyanashree@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Android Issues for Android team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants