Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelpasterz committed Mar 1, 2021
1 parent 8dec8f3 commit b515ac7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/full_suite_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,24 +153,11 @@ jobs:
./gradlew :flank-scripts:download
echo "./flank-scripts/bash" >> $GITHUB_PATH
- name: Prepare run styate JSON
id: state-json
run: |
STATE_JSON='{
"windows-latest": "${{ env.windows-latest }}",
"windows-latest-bs": "${{ env.windows-latest-bs }}",
"ubuntu-latest": "${{ env.ubuntu-latest }}",
"ubuntu-latest-bs": "${{ env.ubuntu-latest-bs }}",
"macos-latest": "${{ env.macos-latest }}",
"macos-latest-bs": "${{ env.macos-latest-bs }}"
}'
echo "::set-output name=run-state::$STATE_JSON"
- name: Process IT results
run: |
flankScripts integration_tests process_results \
--global-result=${{ needs.run-it-full-suite.outputs.job_status }} \
--run-result=${{ steps.state-json.outputs.run-state }} \
--run-result=${{ env }} \
--github-token=${{ secrets.GITHUB_TOKEN }} \
--run-id=${{ github.run_id }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import flank.scripts.ops.integrationtests.common.closeIssue
import flank.scripts.ops.integrationtests.common.createNewIssue
import flank.scripts.ops.integrationtests.common.postComment
import flank.scripts.ops.integrationtests.common.toITRunState
import flank.scripts.utils.toJson
import kotlinx.coroutines.runBlocking

fun processIntegrationTestsResult(
Expand All @@ -21,8 +22,9 @@ fun processIntegrationTestsResult(
runState: String,
runID: String
) {
logArgs(result, runState, runID)
createContext(result, githubToken, runState.toITRunState(), runID).processIntegrationTestsResult()
val state = runState.toITRunState()
logArgs(result, state.toJson(), runID)
createContext(result, githubToken, state, runID).processIntegrationTestsResult()
}

private fun logArgs(
Expand All @@ -31,11 +33,11 @@ private fun logArgs(
runID: String
) = println(
"""
** Parameters:
global run result: $result
run state: $url
runID: $runID
""".trimIndent()
|** Parameters:
| global run result: $result
| run state: $url
| runID: $runID
""".trimMargin()
)

private fun createContext(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ private val issueClosed = """
private val missingUrl = """
** Parameters:
global run result: FAILURE
run state: {}
run state: {
}
runID: 123
** Last workflow run:
name: any-name
Expand Down

0 comments on commit b515ac7

Please sign in to comment.