{"id":21710856,"url":"https://github.com/flank/simple-flank","last_synced_at":"2025-07-18T13:32:23.151Z","repository":{"id":38440392,"uuid":"483395313","full_name":"Flank/simple-flank","owner":"Flank","description":"simple-flank is a Gradle plugin to use Flank in Android projects with no configuration needed","archived":false,"fork":false,"pushed_at":"2023-05-12T19:50:58.000Z","size":218,"stargazers_count":13,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-09T22:57:08.405Z","etag":null,"topics":["android","firebase","gradle"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Flank.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-19T20:13:15.000Z","updated_at":"2023-06-07T20:02:43.000Z","dependencies_parsed_at":"2023-02-08T12:45:57.052Z","dependency_job_id":null,"html_url":"https://github.com/Flank/simple-flank","commit_stats":null,"previous_names":[],"tags_count":6,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flank%2Fsimple-flank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flank%2Fsimple-flank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flank%2Fsimple-flank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flank%2Fsimple-flank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Flank","download_url":"https://codeload.github.com/Flank/simple-flank/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226412773,"owners_count":17621073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","firebase","gradle"],"created_at":"2024-11-25T23:18:07.002Z","updated_at":"2024-11-25T23:18:07.677Z","avatar_url":"https://github.com/Flank.png","language":"Kotlin","readme":"# simple-flank\nsimple-flank is a new gradle plugin with a clear focus: make the setup as simple as possible.\n\nApplied to any application or library module it creates a task called `flankRun` that will run all the android tests (all flavors, debug buildType by default)\n\nTests will be executed using NexusLowRes emulators, and the lower sdk possible (between minSdk and available SDKs at Firebase)\n\n# Setup\n\nApply the plugin on the application/library modules you want to run tests:\n```\nplugins {\n  ...\n  id(\"io.github.flank.gradle.simple-flank\")\n}\n```\n\nadd your firebase credentials to the rootproject as `ftl-credentials.json` or authenticate with your Google Account with `./gradlew flankAuth`\n\nThat's it, run `./gradlew flankRun` and get the results.\n\n# Optional configuration\n\n```kotlin\nsimpleFlank {\n  // Changing the credentials file, default: rootProject.file(\"ftl-credentials.json\")\n  credentialsFile.set(file(\"some-credentials.json\"))\n  \n  // Making the tests cacheable\n  hermeticTests.set(true)\n  // if all modules have hermetic tests, add `simple-flank.hermeticTests=true` to your `gradle.properties`\n\n  // Choosing the devices manually\n  // default is NexusLowRes, and the minSdk from the project\n  devices.set(listOf(\n    io.github.flank.gradle.NexusLowRes(23),\n    io.github.flank.gradle.NexusLowRes(30, \"es_ES\", io.github.flank.gradle.Device.Orientation.landscape),\n    io.github.flank.gradle.Device(\"oriole\", 31, \"Google\", \"Pixel 6\")\n  ))\n\n  // Filtering tests\n  testTargets {\n    inClass(\"io.flank.sample.TestClass\")\n    notInClass(\"io.flank.sample.NotATestClass\", \"io.flank.sample.NotATestClassEither\")\n\n    small() // or medium() or large()\n\n    annotation(\"io.flank.test.InstrumentationTest\")\n    notAnnotation(\"io.flank.test.Flaky\")\n\n    inPackage(\"io.flank.sample\")\n    notInPackage(\"io.flank.external\")\n\n    testFile(\"/sdcard/tmp/testFile.txt\")\n    notTestFile(\"/sdcard/tmp/notTestFile.txt\")\n\n    regex(\"BarTest.*\")\n\n    filter(\"com.android.foo.MyCustomFilter\", \"com.android.foo.AnotherCustomFilter\")\n\n    runnerBuilder(\"com.android.foo.MyCustomBuilder\", \"com.android.foo.AnotherCustomBuilder\")\n  }\n\n  // EnvironmentVariables\n  // default \n  environmentVariables.set(mapOf(\"clearPackageData\" to \"true\", \"something\" to \"1\", \"whatever\" to \"I don't know\"))\n\n  // default extracted from credentials\n  projectId.set(\"my-GCP-project\")\n\n  // Downloading files\n  directoriesToPull.set(listOf(\"/sdcard/\"))\n  filesToDownload.set(listOf(\"a.txt\",\"b.txt\"))\n  keepFilePath.set(true)\n\n\n  // other options\n  testTimeout.set(\"15m\")\n  recordVideo.set(true)\n  numFlakyTestAttempts.set(3)\n  failFast.set(true)\n  performanceMetrics.set(true)\n}\n```\n\n## changing Flank version\n\n```\ndependencies {\n  flankExecutable(\"com.github.flank:flank:21.11.0\")\n}\n```\n\n## Orchestrator\n\n`simple-flank` will configure it automatically if you are using `ANDROIDX_TEST_ORCHESTRATOR`\n\n\n# FAQ\n\n## Can I change the buildType to run?\n\nAndroid already provides a way for you to do it:\n```\nandroid {\n  ...\n  testBuildType = \"beta\"\n  ...\n}\n```\n\n# What happens if I don't have android tests for a project?\n\nMaybe you are applying simple-flank from a convention plugin to all your subprojects. That approach has some issues \nbecause you will run tasks you don't need, but it won't fail, Flank does validate it and abort the execution and \nsimple-flank just ignores that error.\n\nAGP by default considers that all projects have androidTest enabled, but you could fix that with something like:\n```kotlin\n  androidComponents.beforeVariants(selector().withName(\"MY_NO_TESTS_VARIANT\")) { variant -\u003e\n    variant.enableAndroidTest = false\n  }\n```\n\nor check if the androidTest folders exist:\n```kotlin\n  androidComponents.beforeVariants { variant -\u003e\n    val basePath = \"$projectDir/src/androidTest\"\n    val buildTypedPath = basePath + variant.buildType?.capitalize()\n    val flavoredPath = basePath + variant.flavorName?.capitalize()\n    val variantPath = flavoredPath + variant.buildType?.capitalize()\n    variant.enableAndroidTest = (\n      file(basePath).exists() ||\n      file(buildTypedPath).exists() ||\n      file(flavoredPath).exists() ||\n      file(variantPath).exists()\n    )\n  }\n```\n\ndisabling androidTest will save a lot of build time because you won't need to compile, package and run flank for \nthose project.\n\n## How to debug shards?\n\n`./gradlew flankRun -PdumpShards=true`\n\n## What if I want to use a different flank config?\n\nFeel free to [create your own task](docs/manual_tasks_creation.md) and provide the config yaml you want.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflank%2Fsimple-flank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflank%2Fsimple-flank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflank%2Fsimple-flank/lists"}