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

feat: Add app name to the test result #1704

Merged
merged 4 commits into from
Mar 22, 2021

Conversation

pawelpasterz
Copy link
Contributor

@pawelpasterz pawelpasterz commented Mar 16, 2021

Fixes #1674

PR adds a new column (APP NAME) to the result table and updates the outputReport.json structure with an apk file name.

Test Plan

How do we know the code works?

  1. Launch test run with flank with output-report: json
  2. When the run is finished you should see the additional column in the result table with the header APP NAME
  3. There should be apk's file name used in the test
  4. Open outputReport.json
  5. Check if test_results structure is similar to
    "test_results": {
      "matrix-afvw8zv215owa": {
        "app": "app-debug.apk",
        "test-axises": [
    

Checklist

  • Unit tested

@pawelpasterz pawelpasterz self-assigned this Mar 16, 2021
@pawelpasterz pawelpasterz changed the title feature: Add app name to the test result feat: Add app name to the test result Mar 16, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2021

Timestamp: 2021-03-22 08:14:09
Buildscan url for ubuntu-workflow run 675313277
https://gradle.com/s/xhu2pgpd4j7m4

@pawelpasterz
Copy link
Contributor Author

@flank-it

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2021

Integration tests failed ❌
Windows status failure - Build scan:
MacOS status failure - Build scan: https://gradle.com/s/m2ursjv6ylriy
Linux status failure - Build scan: https://gradle.com/s/rtnpwfpycc4iu
Workflow run https://github.com/Flank/flank/actions/runs/662287206

iosXcTest,
iosTestLoop
)
.firstOrNull { it != null }
Copy link
Contributor

Choose a reason for hiding this comment

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

Strange formatting to have a random endline character?
Personal preference or auto corrected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

formatKotlin did that, I'm not happy with it neither but who am I to challenge it :D
Being serious, I'll think of another formatting that is inline with kotlin format task

private val appIpa: FileReference?
) {
val gcsPath: String?
get() = (appApk ?: testsZip ?: appIpa)?.gcsPath
Copy link
Contributor

Choose a reason for hiding this comment

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

interesting resolution, nice and neat but make sure we dont have any order of preference issues here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The order doesn't matter in that case since only one will have a value that is non-null. It comes from TestSpecification object, and that one is a composition of specs:

  • androidInstrumentationTest
  • androidTestLoop
  • androidRoboTest
  • iosXcTest
  • iosTestLoop

Since we are allowed to run only one type of test per matrix only one from above is not null. All android specs have appApk, iOS xc -- testsZip and iOS loop -- appIpa. Let me know if that answers your question :)

@pawelpasterz pawelpasterz force-pushed the 1674-add-apk-name-to-results branch from a3b675d to 9684103 Compare March 18, 2021 13:05
@pawelpasterz
Copy link
Contributor Author

@flank-it

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2021

Integration tests succeed for all OSes ✅
Windows Build scan:
MacOS Build scan: https://gradle.com/s/72a6abrq2uux6
Linux Build scan: https://gradle.com/s/or7e6uqptxr7y
Workflow run https://github.com/Flank/flank/actions/runs/664616860

@pawelpasterz pawelpasterz force-pushed the 1674-add-apk-name-to-results branch from 9684103 to 003dc14 Compare March 18, 2021 14:43
@pawelpasterz pawelpasterz marked this pull request as ready for review March 18, 2021 14:43
@pawelpasterz pawelpasterz requested a review from Sloox March 18, 2021 14:43
@pawelpasterz pawelpasterz enabled auto-merge (squash) March 18, 2021 16:03
@pawelpasterz
Copy link
Contributor Author

@Mergifyio rebase

@bootstraponline bootstraponline force-pushed the 1674-add-apk-name-to-results branch from 003dc14 to 00662c2 Compare March 18, 2021 16:46
@mergify
Copy link

mergify bot commented Mar 18, 2021

Command rebase: success

Branch already up to date

@piotradamczyk5 piotradamczyk5 self-requested a review March 18, 2021 17:56
Copy link
Contributor

@piotradamczyk5 piotradamczyk5 left a comment

Choose a reason for hiding this comment

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

Results table:

┌─────────┬──────────────────────┬───────────────┬────────────────────────────┬────────────────────────────────┐
│ OUTCOME │      MATRIX ID       │   APP NAME    │      TEST AXIS VALUE       │          TEST DETAILS          │
├─────────┼──────────────────────┼───────────────┼────────────────────────────┼────────────────────────────────┤
│ success │ matrix-3qnwchlja84yr │ app-debug.apk │ NexusLowRes-28-en-portrait │ 1 test cases passed, 1 skipped │
└─────────┴──────────────────────┴───────────────┴────────────────────────────┴────────────────────────────────┘

Output report:

"test_results": {
    "matrix-3qnwchlja84yr": {
      "app": "app-debug.apk",
      "test-axises": [
        {
          "device": "NexusLowRes-28-en-portrait",
          "outcome": "success",
          "details": "1 test cases passed, 1 skipped",
          "testSuiteOverview": {
            "total": 2,
            "errors": 0,
            "failures": 0,
            "flakes": 0,
            "skipped": 1,
            "elapsedTime": 3.36,
            "overheadTime": 0.0
          }
        }
      ]
    }
  },

Code review ✅

@bootstraponline bootstraponline force-pushed the 1674-add-apk-name-to-results branch from 00662c2 to 10322c6 Compare March 22, 2021 08:08
@pawelpasterz pawelpasterz merged commit 7a5cbbc into master Mar 22, 2021
@pawelpasterz pawelpasterz deleted the 1674-add-apk-name-to-results branch March 22, 2021 08:26
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add apk name in the output results
4 participants