ARES

Introduction

Maven Central Build Status License

ARES(Android Report Synchro) Plugin

Receiving allure result files to the allure-results folder with enrichment of different information (on which device the test is running, device model, device OS version)

ARES Execution Plugin

ARES(Android Report Synchro) Plugin + test execution tasks

Based on files from execution of allure-kotlin and marathon

allure-kotlin: https://github.com/allure-framework/allure-kotlin marathon: https://github.com/Malinskiy/marathon

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Quick start

Add maven central repo

repositories {
  mavenCentral()
}

Add ARES plugin(basic)

implementation 'io.github.sergkhram:ares-plugin:1.2.1-RELEASE'

Or ARES execution plugin

implementation 'io.github.sergkhram:ares-exec-plugin:1.2.1-RELEASE'

Apply ARES plugin

plugins {
  id 'io.github.sergkhram.aresPlugin'
}

Or ARES execution plugin

plugins {
  id 'io.github.sergkhram.aresExecPlugin'
}

Required gradle version >= 6.8

If you have this problem after implementing ARES execution plugin:

FAILURE: Build failed with an exception.

What went wrong:
A problem occurred configuring project ':app'.
 Failed to notify project evaluation listener.
    com.google.common.collect.ImmutableList.toImmutableList()Ljava/util/stream/Collector;

You need to add guava implementation:

classpath('com.google.guava:guava'){
    version {
        strictly '30.1.1-jre'
    }
}

Tasks

ARES plugin(basic)

reportSync is required to copy videos, environment file and device allure results data to the allure-results folder. Example: gradle reportSync --no-daemon (or with gradle wrapper gradlew reportSync --no-daemon)

reportGen is required to copy videos, environment file and device allure results data to the allure-results folder + Allure report generation. Example: gradle reportGen --no-daemon (or with gradle wrapper gradlew reportGen --no-daemon)

ARES execution plugin

reportSync is required to copy videos, environment file and device allure results data to the allure-results folder. Example: gradle reportSync --no-daemon (or with gradle wrapper gradlew reportSync --no-daemon)

reportGen is required to copy videos, environment file and device allure results data to the allure-results folder + Allure report generation. Example: gradle reportGen --no-daemon (or with gradle wrapper gradlew reportGen --no-daemon)

runTestsWReportSync is required to run tests via 'executeBy' parameter + copy videos, environment file and device allure results data to the allure-results folder. Example: gradle runTestsWReportSync --no-daemon (or with gradle wrapper gradlew runTestsWReportSync --no-daemon)

runTestsWReportGen is required to run tests via 'executeBy' parameter + copy videos, environment file and device allure results data to the allure-results folder + Allure report generation. Example: gradle runTestsWReportGen --no-daemon (or with gradle wrapper gradlew runTestsWReportGen --no-daemon)

If you are using ARES execution plugin(not the basic) and want to start a pure marathon task(gradle marathon or gradle marathonDebugAndroidTest or others) - you need to set -DmarathonIgnoreFailures=false when executing the command

Properties

screenRecordType is required to select the current attachment type of the marathon screen recording. There are two options: SCREENSHOT and VIDEO (default is SCREENSHOT, also for empty screenRecordType property). SCREENSHOT is for GIF, VIDEO is for MP4.

buildType is required when you have more then two build types and variants (default is debug) enrichBy is required to select the variant of getting allure-results. There are two options: MARATHON and CLEAN_ALLURE (default is MARATHON, also for empty enrichBy property). MARATHON is for getting from marathon orchestrator report, CLEAN_ALLURE is just for pulling results from device with data enrichment.

remoteAllureFolder is required to set the path of device allure-results directory (default is /sdcard/allure-results, also for empty remoteAllureFolder property). It’s only for enrichBy=CLEAN_ALLURE

isMarathonCLI is required to get results from marathon report, that has been generated by marathon cli (default is false)

reportDirectory is required to set the report directory path, if you are using marathon CLI (it’s only for isMarathonCLI=true)

deviceSerials is required to set a list of device serial numbers from which you need to get the allure results(it’s only for enrichBy=CLEAN_ALLURE)

startAsyncResultFilesTransferFrom is the value of allure result files count(*-result.json) from which is required to use parallel transferring (default is 200)

startAsyncOtherFilesTransferFrom is the value of allure other files count(not the *-result.json, like attachments) from which is required to use parallel transferring (default is 500)

asyncFilesTransferThreadsCount is the value of threads count, that will be used for parallel transferring in case of startAsyncResultFilesTransferFrom or startAsyncOtherFilesTransferFrom (default is 10)

androidHome is the value of android home directory path(default is checking android home default location or ANDROID_HOME system property)

executeBy is required only for ARES execution plugin - execution variant(does not matter by default - if you are not set it here or in extension - runTests tasks will not be created). There is only one option: MARATHON

executionIgnoreFailures is required only for ARES execution plugin - if you want an always successful build

copyCrashedTests is required to copy marathon allure result file of crashed test(without device allure result file, default is false) - only for enrichBy = MARATHON

ARES extension

You can use ares {...} in your build.gradle(:app) and set the configuration as extension. For example:

ares {
    enrichBy = "MARATHON"
    marathonBlock {
        buildType = "debug"
    }
    startAsyncResultFilesTransferFrom = 100
    startAsyncOtherFilesTransferFrom = 300
    asyncFilesTransferThreadsCount = 20
}

or

ares {
    enrichBy = "CLEAN_ALLURE"
    allureBlock {
        deviceSerials = "emulator-5554,emulator-5556"
    }
    startAsyncResultFilesTransferFrom = 300
    startAsyncOtherFilesTransferFrom = 1000
    asyncFilesTransferThreadsCount = 50
}

root properties:

enrichBy - String (MARATHON || CLEAN_ALLURE)

startAsyncResultFilesTransferFrom - Integer

startAsyncOtherFilesTransferFrom - Integer

asyncFilesTransferThreadsCount - Integer

androidHome - String

marathonBlock properties:

screenRecordType - String (VIDEO || SCREENSHOT)

buildType - String

isMarathonCLI - Boolean

reportDirectory - String

copyCrashedTests - Boolean

allureBlock properties:

remoteAllureFolder - String

deviceSerials - String with delimiter ‘,’

ARES execution plugin

ares {
    enrichBy = "MARATHON"
    marathonBlock {
        buildType = "debug"
    }
    startAsyncResultFilesTransferFrom = 100
    startAsyncOtherFilesTransferFrom = 300
    asyncFilesTransferThreadsCount = 20
    testExecutionBlock {
        executeBy = "MARATHON"
        executionIgnoreFailures = false
    }
}

testExecutionBlock properties:

executeBy - String

executionIgnoreFailures - Boolean