Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

WIP json for HTML report. #24

Merged
merged 3 commits into from
May 6, 2017
Merged

WIP json for HTML report. #24

merged 3 commits into from
May 6, 2017

Conversation

artem-zinnatullin
Copy link
Collaborator

Part of #11.

@ming13, @dmitry-novikov PTAL — it's core of implementation, no tests yet since, as I've said I had to "duplicate" some classes like Test/Suite/Device across different layers, I now have an idea to divide Composer into separate (in code) pieces:

  • Instrumentation level — parses instrumentation output, constructs very basic Test entity.
  • Adb device test run level — uses Instrumentation level, constructs more sophisticated Test and TestRun entities that have not only basic test info but also screenshots, files and some meta info.
  • Core business logic level — uses Adb device test run level and isolates other components like JUnit4 report generator and HTML report generator from adb level by converting results into own data classes.

Then JUnit4 and HTML reports can be completely unaware of underlying details of execution.

@SerializedName("ignoredCount")
val ignoredCount: Int,

@SerializedName("failedCount")
Copy link
Member

Choose a reason for hiding this comment

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

Snake notation? I guess it is more common.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, yes yes, will do

@@ -15,6 +15,7 @@ dependencies {
compile libraries.commanderAndroid
compile libraries.apacheCommonsIo
compile libraries.apacheCommonsLang
compile libraries.gson
Copy link
Member

Choose a reason for hiding this comment

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

Moshi?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

KotlinJsonAdapter not released yet

}
.map { adbDeviceTestRuns ->
when (args.shard) {
// In "shard=true" mode test runs from all devices combined into one suite of tests.
Copy link
Member

Choose a reason for hiding this comment

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

Indentation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Autoformat :(

@@ -74,7 +74,7 @@ private fun parseInstrumentationEntry(str: String): InstrumentationEntry =
}
.let { statusCode ->
when (statusCode) {
null -> throw IllegalStateException("Unknown test result status code [$statusCode], please report that to Composer maintainers $str")
null -> throw IllegalStateException("Unknown test status status code [$statusCode], please report that to Composer maintainers $str")
Copy link
Contributor

Choose a reason for hiding this comment

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

"status status code" or just "status code"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

my bad, thanks

status = when (status) {
AdbDeviceTest.Status.Passed -> HtmlTest.Status.Passed
AdbDeviceTest.Status.Ignored -> HtmlTest.Status.Ignored
is AdbDeviceTest.Status.Failed -> HtmlTest.Status.Failed
Copy link
Contributor

Choose a reason for hiding this comment

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

'is'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, it's a class, not an object

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, ok

@artem-zinnatullin artem-zinnatullin merged commit d4e81f3 into master May 6, 2017
@artem-zinnatullin artem-zinnatullin deleted the az/html-report-json branch May 6, 2017 11:41
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.

4 participants