Skip to content

Support for running multiple runFlank tasks with configs #141

Closed

Description

@SamThompson

I noticed that if I try to run multiple runFlank tasks for different configs, only the config for the last runFlank task is used

For example, if I have a build.gradle file that does this:

...

fladle {
    smokeTest {
        testTargets = ['annotation SmokeTest']
    }
    expandedSmokeTest {
        testTargets = ['annotation ExpandedSmokeTest']
    }
}

and then try to run

./gradlew :app:runFlankSmokeTests :app:runFlankExpandedSmokeTests

The output would be something like:

> Task :app:execFlankSmokeTest
version: v20.06.1
revision: ...
AndroidArgs
    gcloud:
      ...
      test-targets:
        - annotation ExpandedSmokeTest
...
> Task :app:execFlankExpandedSmokeTest
version: v20.06.1
revision: ...
AndroidArgs
    gcloud:
      ...
      test-targets:
        - annotation ExpandedSmokeTest

Digging into the gradle log, I think this might be caused by the yaml file being overwritten because I see these lines sequentially:

> Task :app:writeConfigPropsSmokeTest
> Task :app:writeConfigPropsExpandedSmokeTest

Activity

  1. pawelpasterz commented on Jun 25, 2020

    @pawelpasterz
    Contributor

    I think this is due to how additional configs are created. For primitive values it's fine but here we have list. Then its reference is assigned to variable and then it is overwritten (but it's rather guess than assumption, @runningcode WDYT?)

  2. runningcode commented on Jun 26, 2020

    @runningcode
    Owner

    Yes, that's exactly it. The Yaml file is always written to the same directory. They should be written to a task specific directory.
    To be honest, I've never thought about this use case, but I think it doesn't make sense because you will not get a unified test and/or error report. I would recommend creating a new config called smokeTestAndExpandedSmokeTest.

    Can you tell me more about this use case and why smokeTestAndExpandedSmokeTest doesn't work here?

    If we wanted to fix this we would also need to fix that, all the outputs are also being written to the same directory. They will also need config specific outputs. This could break existing implementations. Flank clears certain output directories before writing to them so the outputs of one test would overwrite the outputs of the other.

  3. SamThompson commented on Jun 26, 2020

    @SamThompson
    Author

    I did some testing and it looks like when annotations are used in a filter in am instrument -e, it takes the intersection of the set of tests that have the specified annotations. I ended up adding the ExpandedSmokeTest annotation to everywhere I have SmokeTest and just went with running the expanded smoke test config.

    The usecase was mainly for convenience since it seemed like it was the easiest way to run both sets of tests. Just wanted to flag this since I was initially confused by the behavior.

  4. bootstraponline commented on Jun 27, 2020

    @bootstraponline

    I’m happy to make changes in flank to support this use case.

  5. runningcode commented on Jun 27, 2020

    @runningcode
    Owner

    That sounds very nice! It's always good to understand the use case and see if this feature is worth maintaining and building.
    There are two possible paths if i understand this correctly:

    1. Flank could support union filters on annotations.
    2. We would need some sort of flank for flank tool that would execute flank twice (or any arbitrary number of times), wait for the results and then merge the already merged reports. We would also have to make sure that flank supports being executed any number of times simultaneously. This would involve ensuring that there are not overlapping directories for temporary outputs or network requests and authentication.
      What do you think @bootstraponline ?
  6. bootstraponline commented on Jun 27, 2020

    @bootstraponline
    1. Flank could support union filters on annotations.

    This seems like the best starting point, I'll discuss with the team.

  7. jan-goral commented on Jul 3, 2020

    @jan-goral
    1. Flank could support union filters on annotations.

    After call with team we agreed is impossible to fix issue only on flank side. Even if we adjust annotation filters to support union, this will not prevent from overriding results when running multiple executions so flade should handle output directory for that case. Anyway current test targets implementation in flank behave exactly like adb shell am instrument ... - e ... filters. If we add support for union, there will be difference.

  8. bootstraponline commented on Jul 3, 2020

    @bootstraponline

    That makes sense. I think looking into updating fladle to support multiple runs is the next step then.

  9. runningcode commented on Jul 11, 2020

    @runningcode
    Owner

    I've created #147, #148 and #149 to outline what needs to happen from the fladle plugin side to make this possible. Feel free to pick up any of that work.

    Will there also be some changes needed to flank itself in order to merge the test reports?

  10. bootstraponline commented on Jul 12, 2020

    @bootstraponline

    Will there also be some changes needed to flank itself in order to merge the test reports?

    Yeah, it's not clear what the best way to do this is. I'll chat with the team.

  11. pawelpasterz commented on Jan 11, 2021

    @pawelpasterz
    Contributor

    Hey @runningcode is it possible this issue was fixed with #194 ?

  12. runningcode commented on Jan 11, 2021

    @runningcode
    Owner

    Correct, that should have fixed it. Going to close this out. Feel free to re-open if it still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions