-
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.
- Loading branch information
1 parent
693b179
commit e7197a0
Showing
3 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
test_runner/src/main/kotlin/ftl/reports/util/MatrixPath.kt
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,11 @@ | ||
package ftl.reports.util | ||
|
||
import java.io.File | ||
import java.nio.file.Paths | ||
|
||
fun File.getMatrixPath(objectName: String) = getShardName()?.asObjectPath(objectName) | ||
|
||
private fun File.getShardName() = shardNameRegex.find(toString())?.value?.removePrefix("/")?.removeSuffix("/") | ||
private val shardNameRegex = "/.*(shard_|matrix_)\\d+(-rerun_\\d+)?/".toRegex() | ||
|
||
private fun String.asObjectPath(objectName: String) = Paths.get(objectName, this).toString() |
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