-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into #899-test-artifacts-scripts
- Loading branch information
Showing
73 changed files
with
912 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,12 @@ on: | |
|
||
jobs: | ||
release: | ||
runs-on: macos-latest | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Get all git tags | ||
run: | | ||
|
@@ -108,11 +110,12 @@ jobs: | |
gradle-executable: "./test_runner/gradlew" | ||
arguments: "-p test_runner publish -PGITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Post Message of Flank Release TEST ONLY | ||
uses: archive/github-actions-slack@master | ||
- name: Post Message of Flank Release | ||
uses: Flank/[email protected] | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
with: | ||
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }} | ||
slack-channel: flank_test_channel | ||
slack-optional-icon_emoji: ":fire:" | ||
slack-text: Flank ${{ env.RELEASE_TAG }} has been released. View more information <http://github.com/Flank/flank/releases/tag/${{ env.RELEASE_TAG }}| here!> | ||
xoxctoken: ${{ secrets.SLACK_XOXCTOKEN }} | ||
message: Flank ${{ env.RELEASE_TAG }} has been released. View more information <http://github.com/Flank/flank/releases/tag/${{ env.RELEASE_TAG }}| here!> | ||
channel: ${{ secrets.SLACK_CHANNEL}} | ||
cookie: ${{ secrets.SLACK_COOKIE}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: slack-user-bot | ||
|
||
description: Make a user act like a bot in slack | ||
author: Flank | ||
|
||
branding: | ||
icon: file-plus | ||
color: blue | ||
|
||
runs: | ||
using: 'docker' | ||
image: './flank-actions/Dockerfile' | ||
|
||
inputs: | ||
xoxctoken: | ||
description: A slack token that gives permission to act as a user. | ||
required: true | ||
message: | ||
description: The message to send | ||
required: true | ||
channel: | ||
description: Channel to send to | ||
required: true | ||
cookie: | ||
description: Required cookie for auth | ||
required: true |
36 changes: 36 additions & 0 deletions
36
docs/bugs/986_test_count_and_smart_sharding_ count_dont_match.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Test count and smart sharding count don't match | ||
|
||
Bug reported in [this issue](https://github.com/Flank/flank/issues/986) | ||
|
||
## The problem | ||
|
||
Flank does not support parameterized tests sharding. Every class with parameterized is considered as one test during shard calculation. | ||
|
||
Flank is using [DEX parser](https://github.com/linkedin/dex-test-parser) to decompile apks and gather info about all the tests inside. As for now, Flank is unable to determine how many times a test in a parameterized class is invoked. Due to this fact scans apks for any class with an annotation that contains `JUnitParamsRunner` or `Parameterized`: | ||
|
||
```kotlin | ||
|
||
@RunWith(JUnitParamsRunner::class) | ||
... | ||
@RunWith(Parameterized::class) | ||
|
||
``` | ||
|
||
## Solution | ||
|
||
1. Flank knows how many tests and classes are being sent to Firebase. So we can inform the user of how many classes we have. Example: | ||
|
||
```txt | ||
Smart Flank cache hit: 0% (0 / 9) | ||
Shard times: 240s, 240s, 240s, 360s | ||
Uploading app-debug.apk . | ||
Uploading app-multiple-flaky-debug-androidTest.apk . | ||
5 tests + 4 parameterized classes / 4 shards | ||
``` | ||
|
||
1. Default test time for classes should be different from the default time for test | ||
1. You can set default test time for class with ```--default-class-test-time``` command | ||
2. If you did not set this time, the default value is 240s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM openjdk:8-alpine | ||
|
||
COPY . / | ||
|
||
RUN apk add bash curl git zip && \ | ||
curl -s "https://get.sdkman.io" | bash | ||
|
||
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk version" | ||
|
||
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk install kotlin" | ||
|
||
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk install kscript" | ||
|
||
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk install gradle" | ||
|
||
RUN chmod +x /compile.sh | ||
|
||
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && /compile.sh" | ||
|
||
RUN chmod +x /entrypoint.sh | ||
|
||
RUN chmod +x /sendMessage | ||
|
||
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && /test.sh" | ||
|
||
ENTRYPOINT /bin/bash /entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
object Common { | ||
const val EXIT_CODE_SUCCESS = 0 | ||
const val EXIT_CODE_FAILURE = -1 | ||
const val URL_SLACK ="https://slack.com/api/chat.postMessage" | ||
const val ARGS_TOKEN = 0 | ||
const val ARGS_CHANNEL = 1 | ||
const val ARGS_MESSAGE = 2 | ||
const val ARGS_COOKIE = 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
kscript --package sendMessage.kts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo 'Sending message' | ||
./sendMessage $INPUT_XOXCTOKEN $INPUT_MESSAGE $INPUT_CHANNEL $INPUT_COOKIE | ||
echo 'Sending message done!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import kotlin.system.exitProcess | ||
|
||
|
||
//DEPS com.github.kittinunf.fuel:fuel:2.2.3 | ||
|
||
//INCLUDE slackService.kt | ||
//INCLUDE common.kt | ||
|
||
val result = sendMessage(args) | ||
|
||
println("Message has been sent with result $result") | ||
|
||
if (result != 0){ | ||
exitProcess(result) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
import com.github.kittinunf.fuel.Fuel | ||
import com.github.kittinunf.fuel.core.Headers | ||
|
||
fun sendMessage(args: Array<String>): Int{ | ||
val token = args[Common.ARGS_TOKEN] | ||
val channel = args[Common.ARGS_CHANNEL] | ||
val message = args[Common.ARGS_MESSAGE] | ||
val cookie = args.copyOfRange(Common.ARGS_COOKIE, args.lastIndex).joinToString(" ") | ||
|
||
return try { | ||
val (req, rep, res) = Fuel.get(Common.URL_SLACK, | ||
listOf("token" to token,"channel" to channel,"text" to message)) | ||
.header(Headers.COOKIE to cookie) | ||
.responseString() | ||
|
||
debug("Result: $res") | ||
Common.EXIT_CODE_SUCCESS | ||
} | ||
catch(e: Exception) { | ||
error("Error has occured: $e") | ||
Common.EXIT_CODE_FAILURE | ||
} | ||
} | ||
|
||
fun debug(message: String){ | ||
println("::debug::$message") | ||
} | ||
|
||
fun error(message: String) { | ||
println("::error::$message") | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.