Skip to content

Write output into specific directory#194

Merged
runningcode merged 7 commits into
runningcode:masterfrom
pawelpasterz:write-flank-output-to-specific-directory
Nov 4, 2020
Merged

Write output into specific directory#194
runningcode merged 7 commits into
runningcode:masterfrom
pawelpasterz:write-flank-output-to-specific-directory

Conversation

@pawelpasterz

@pawelpasterz pawelpasterz commented Oct 21, 2020

Copy link
Copy Markdown
Contributor

Fixes #148

If no localResultsDir set fladle will configure tasks (for each configuration) with a working directory specific to each configuration.
This allows delegating the creation of the results directory to the flank.

./build
├── fladle
│   ├── additionaltests
│   │   ├── flank.yml
│   │   └── results
│   │       ├── 2020-10-22_09-05-18.840938_jjYb
│   │       ├── 2020-10-22_09-08-39.804644_GlIW
│   │       └── 2020-10-22_09-20-23.489689_CUlO
│   ├── flank.yml
│   ├── oranges
│   │   ├── flank.yml
│   │   └── results
│   │       └── 2020-10-22_09-23-17.856220_nUGS
│   └── results
│       └── 2020-10-22_09-24-01.277166_Ktpj

Comment thread buildSrc/src/main/java/com/osacky/flank/gradle/results/UniqueName.kt Outdated
Comment thread buildSrc/src/main/java/com/osacky/flank/gradle/FladlePluginDelegate.kt Outdated

@runningcode runningcode left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! just some small nits!

@pawelpasterz pawelpasterz reopened this Oct 22, 2020
@pawelpasterz
pawelpasterz force-pushed the write-flank-output-to-specific-directory branch from dfe8995 to 5c33c9e Compare October 22, 2020 09:13
validateOptionsUsed(config = config, flank = base.flankVersion.get())
val configName = name.toLowerCase()
val useDefaultDir = config.localResultsDir.isPresent.not() && configName.isNotBlank()
val setUpWorkingDir: JavaExec.() -> Unit = { if (useDefaultDir) workingDir(project.layout.buildDirectory.dir("fladle/$configName")) }

@runningcode runningcode Oct 22, 2020

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woah is this a function declared in line? never seen that before, but since we have control of the FlankJavaExec task, can we just define the function in there?
otherwise, i think this makes sense. we'll need some tests for this though since i'm getting quite confused with all the conditional logic :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm...sure I can rewrite it, my intention was, a function that is used to set up working dir is created for each configuration (wraps some params in the scope)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise, i think this makes sense. we'll need some tests for this though since i'm getting quite confused with all the conditional logic :)

That could be hard (at least for me). I don't know how to programmatically verify if working directory is correctly set. Another approach would be to invoke runFlank[config] -PdumpShards and check if json is saved into correct dir but that would require CI to be authenticated...

@pawelpasterz

Copy link
Copy Markdown
Contributor Author

@runningcode I simplified logic a bit and moved set up dir function into FlankJavaExec

@pawelpasterz
pawelpasterz marked this pull request as ready for review October 23, 2020 08:12
@runningcode
runningcode merged commit dbce1bd into runningcode:master Nov 4, 2020
@github-actions

github-actions Bot commented Nov 4, 2020

Copy link
Copy Markdown

Buildscan url for run 345638774

runningcode pushed a commit that referenced this pull request Apr 15, 2021
The changes introduced in #194 could break some setups. Let's mention it in the changelog.
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

Successfully merging this pull request may close these issues.

Write flank output to a task specific directory

2 participants