Closed johnjohndoe closed 9 months ago
Invoking the publish action twice requires individual check_name
values, e.g.
build
job should use check_name: 'Test Results (build)'
android_tests
job should use check_name: 'Test Results (instrumentation)'
Regarding the missing test results: your File listing
step shows there are no TEST*.xml
files in path .
:
find . -name "TEST*.xml"
echo "All files:"
find .
There are no files listed before All files
:
All files:
.
Further, there is no test-results
directory in .
, so test-results/**/*.xml
cannot find anything.
I added the check_name
option now, see runs/7769998601.
Further, there is no
test-results
directory in.
, sotest-results/**/*.xml
cannot find anything.
Do you know why the xml files are missing and how I can fix it?
When I run the tests locally on an emulator then the following files are generated:
└── outputs
└── androidTest-results
└── connected
├── TEST-Pixel_7_API_33(AVD) - 13-_database-.xml
└── test-result.pb
No idea, seems unrelated to this action, maybe you should check with https://github.com/reactivecircus/android-emulator-runner.
OK. I just confirmed that instrumentation tests are skipped: runs/7773288979/job/21196786085 :(
If you see no errors in the configuration for this action then you can close this issue. Thank you.
I fixed running the instrumentation tests now (I had to scope the Gradle task to the module) ...
script: ./gradlew :database:connectedAndroidTest
... and I can see an xml file being generated. See runs/7773831930.
./database/build/outputs/androidTest-results/connected/TEST-test(AVD) - 10-_database-.xml
It isn't picked up by the results action, though.
Warning: Could not find any files for androidTest-results/**/*.xml, */androidTest-results/**/*.xml
Because androidTest-results/**/*.xml
and */androidTest-results/**/*.xml
cannot match ./database/build/outputs/androidTest-results/connected/TEST-test(AVD) - 10-_database-.xml
.
Try **/androidTest-results/**/*.xml
instead.
Awesome. It works now.
Thank you!
Context
I like to see test results both for unit and instrumentation tests for my Android application project. It contains a few different Gradle modules (android application, android library, kotlin library) and tests in the
test
andandroidTest
source sets. Also, it contains multiple product flavors. Here is the workflow configuration: 7760612891/workflowCurrent state
Test results for unit tests (
test
source set) are written to the respective modulebuild/test-results/
folders, e.g.app/build/test-results/testCcc37c3DebugUnitTest/TEST-nerd.tuxmobil.fahrplan.congress.alarms.AlarmServicesTest.xml
. These XML files are then correctly picked up by thepublish-unit-test-result-action
.Test results for instrumentation tests (
androidTest
source set) seem to be missing and therefore are not picked up.The instrumentation tests are part of the
database
module. They do not target UI but still need the Android framework to run. See: database/androidTestRelated