Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Broken testTargetsForShard #282

Open
inehemiasm opened this issue Oct 28, 2021 · 4 comments
Open

Broken testTargetsForShard #282

inehemiasm opened this issue Oct 28, 2021 · 4 comments

Comments

@inehemiasm
Copy link

inehemiasm commented Oct 28, 2021

Hi, i am trying to distribute a set of tests A on one shard and set of testsB on a separate shard. I assume that't the solution would be to configure something like this:

testTargetsForShard.set( 
  project.provider { 
    listOf( 
      "class com.example.testsA",
      "class com.example.testsB"
    )
  }
) 

when i execute ./gradlew printYml i noticed that it's set properly

test-targets-for-shard: 
   - class com.example.testsA"
   - class com.example.testsB"

However, when i execute ./gradlew runFlank
I get the following error:

RunTests
java.nio.file.NoSuchFileException: /Users/username/Documents/ProjectPath/My-Project/app/build/fladle/results/2021-10-28_04-46-04.721060_dpnG/android_shards.json

        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
Total run duration: 0m  3s
        at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
        - Preparation: 0m 2s
        at java.base/java.nio.file.Files.newByteChannel(Files.java:375)
        at java.base/java.nio.file.Files.newByteChannel(Files.java:426)
        at java.base/java.nio.file.Files.readAllBytes(Files.java:3272)
        at ftl.run.platform.RunAndroidTestsKt.dumpShards(RunAndroidTests.kt:83)
        at ftl.run.platform.RunAndroidTestsKt.access$dumpShards(RunAndroidTests.kt:1)
        at ftl.run.platform.RunAndroidTestsKt$runAndroidTests$2.invokeSuspend(RunAndroidTests.kt:46)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)
        at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at ftl.presentation.RunStateKt.runBlockingWithObservingRunState(RunState.kt:17)
        at ftl.domain.RunTestAndroidKt.invoke(RunTestAndroid.kt:63)
        at ftl.presentation.cli.firebase.test.android.AndroidRunCommand.run(AndroidRunCommand.kt:58)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at ftl.Main$main$1.invoke(Main.kt:12)
        at ftl.Main$main$1.invoke(Main.kt:10)
        at ftl.run.exception.ExceptionHandlerKt.withGlobalExceptionHandling(ExceptionHandler.kt:28)
        at ftl.run.exception.ExceptionHandlerKt.withGlobalExceptionHandling(ExceptionHandler.kt:17)
        at ftl.Main.main(Main.kt:10)

> Task :app:execFlank FAILED

It seems that it tries to grab android_shards.json file that was never generated. Unless the user have to manually provide it

@runningcode
Copy link
Owner

This seems like a bug in flank. What version of flank are you using?

@philite
Copy link

philite commented Sep 15, 2022

Hello, I found the same problem. I did try using from flankVersion = "21.01.1" to latest flank version and still not getting it work either.

@moetouban
Copy link

moetouban commented Oct 2, 2022

i have the same issue as well version: v22.05.0. have you find out what is causing it and how to fix ?

@moetouban
Copy link

@runningcode this issue doesn't happen on flank v22.05.0
I print the yaml config file generated from fladle and noticed one thing off which is
custom-sharding-json: null if I remove this flag and run the config directly through flank I don't have the issue anymore.
This flag seems to be generated from the fladle plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants