Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: Add logic to verify xml results #1362

Merged
merged 16 commits into from
Dec 11, 2020
Merged

Conversation

adamfilipow92
Copy link
Contributor

@adamfilipow92 adamfilipow92 commented Nov 27, 2020

Fixes #1315

Test Plan

How do we know the code works?

  1. run ./gradlew integrationTests
  2. integration tests should pass

Description

Flank should also verify XML results for android and ios integration tests.

This ticket should be merged after #1316 when we update all tests.

filter all tests - ios is disabled and should be updated in #1388

Checklist

@codecov-io
Copy link

codecov-io commented Nov 27, 2020

Codecov Report

Merging #1362 (1c6c083) into master (9d1ba8d) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1362      +/-   ##
============================================
+ Coverage     77.56%   77.58%   +0.02%     
  Complexity      717      717              
============================================
  Files           248      248              
  Lines          4788     4788              
  Branches        915      915              
============================================
+ Hits           3714     3715       +1     
  Misses          572      572              
+ Partials        502      501       -1     

@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2020

Timestamp: 2020-12-11 12:58:58
Buildscan url for ubuntu-workflow run 415427673
https://gradle.com/s/vf5wovfx6vsbg

@bootstraponline bootstraponline changed the title feat: Add logic to veryfi xml results feat: Add logic to verify xml results Nov 30, 2020
@@ -29,6 +30,7 @@ class AllTestFilteredIT {
}

@Test
@Ignore("Should be fixed in https://github.com/Flank/flank/issues/1388")
Copy link
Contributor

Choose a reason for hiding this comment

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

should we ignore this test for all OS ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

only for ios, android works but output could change after #1388

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this will be picked up and removed in that ticket. Can we add a // TODO with a ticket number

@@ -1,3 +1,6 @@
gcloud:
test: ../test_runner/src/test/kotlin/ftl/fixtures/tmp/earlgrey_example.zip
xctestrun-file: ../test_runner/src/test/kotlin/ftl/fixtures/tmp/EarlGreyExampleSwiftTests_iphoneos13.4-arm64e.xctestrun
device:
- model: iphone8
version: 13.6
Copy link
Contributor

Choose a reason for hiding this comment

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

should we force to use this device?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should use the default device. Thanks! Changed

Copy link
Contributor

@jan-goral jan-goral left a comment

Choose a reason for hiding this comment

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

The code looks ok, but IT tests are failing on my local run. I guess it's related to my local configuration rather than the branch.

https://gist.github.com/jan-gogo/5b52b7a2c6fc0d085175bfa0b2b749c7

@@ -65,16 +65,5 @@ RunTests
Saved 1 shards to android_shards.json
Uploading app-debug.apk \.*
Uploading app-single-success-debug-androidTest.apk \.*
1 test / 1 shard
Copy link
Contributor

Choose a reason for hiding this comment

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

Why those lines are removed?
I launched it locally and the timeout case failed because of it 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Locally I get the output without removed lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed this test by using test and apk from gcs. Using local files can produce different outputs related to file uploading speed.


fun TestSuites.assertCountOfSkippedTests(expectedCount: Int) = assertEquals(expectedCount, testSuites.sumBy { it.skipped })

fun TestSuites.assertCountOfFailedTests(expectedCount: Int) = assertEquals(expectedCount, testSuites.count { it.failures > 0 })
Copy link
Contributor

Choose a reason for hiding this comment

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

does detekt not pick this up as too long? can you run it?

@@ -29,6 +30,7 @@ class AllTestFilteredIT {
}

@Test
@Ignore("Should be fixed in https://github.com/Flank/flank/issues/1388")
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this will be picked up and removed in that ticket. Can we add a // TODO with a ticket number

import utils.testResults.TestSuites
import java.io.File

fun File.loadAsTestSuite(): TestSuites = XmlMapper().registerModule(KotlinModule()).readValue(this, TestSuites::class.java)
Copy link
Contributor

Choose a reason for hiding this comment

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

Again with long lines and detekt failing. Do you have githooks installed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I have installed it.
Strange. To be sure I run detekt and check and both pass.

import java.io.File
import java.nio.file.Paths

fun String.findTestDirectoryFromOutput() = "results-dir:\\s.*\\s".toRegex().find(this)?.value.orEmpty().trim().replace("results-dir: ", "")
Copy link
Contributor

Choose a reason for hiding this comment

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

same here.

Copy link
Contributor

@jan-goral jan-goral left a comment

Choose a reason for hiding this comment

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

changed to request changes

Copy link
Contributor

@jan-goral jan-goral left a comment

Choose a reason for hiding this comment

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

One test was failed on my local run

https://gist.github.com/jan-gogo/9e2f4d96f05f1efc3a1831bd1709d95e

[EDIT]
...due to Insufficient test quota

@mergify mergify bot merged commit 354213d into master Dec 11, 2020
@mergify mergify bot deleted the 1315-it-verify-xml-results branch December 11, 2020 15:49
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IT] Add logic to verify xml results
6 participants