Skip to content

Commit 1994a6b

Browse files
committed
Update unit test artifacts
1 parent d8c9f60 commit 1994a6b

File tree

3 files changed

+34
-31
lines changed

3 files changed

+34
-31
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
skip-cache: true
5353
- name: Set Linting Outputs
5454
if: success() || failure()
55-
run: bash ./scripts/workflow/format_workflow_outputs.sh ${{ job.status }} ${{ env.START_TIME }} lint-result.json
55+
run: bash ./scripts/workflow/format_workflow_outputs.sh ${{ job.status }} ${{ env.START_TIME }} lint-output.json lint-result.json
5656
- name: Upload Artifact
5757
if: success() || failure()
5858
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
@@ -79,7 +79,7 @@ jobs:
7979
files: ./build/test/coverage.out
8080
- name: Set Unit Test Outputs
8181
if: success() || failure()
82-
run: bash ./scripts/workflow/format_workflow_outputs.sh ${{ job.status }} ${{ env.START_TIME }} unit-test-result.json
82+
run: bash ./scripts/workflow/format_workflow_outputs.sh ${{ job.status }} ${{ env.START_TIME }} unit-test-output.json unit-test-result.json
8383
- name: Upload Artifact
8484
if: success() || failure()
8585
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3

scripts/workflow/format_workflow_outputs.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/sh
22

3-
LINT_FILE="$3"
43
START_TIME="$2"
4+
IN_FILE="$3"
5+
OUT_FILE="$4"
56
END_TIME="`date "+%Y-%m-%dT%H:%M:%S.%NZ"`"
67
START_SECONDS=$(date -d "$START_TIME" +%s.%N)
78
END_SECONDS=$(date -d "$END_TIME" +%s.%N)
@@ -16,14 +17,16 @@ else
1617
RESULT="skip"
1718
fi
1819

19-
if [[ -f "$LINT_FILE" ]]; then
20-
NUM_ISSUES=$(jq '.Issues | length' "$LINT_FILE")
20+
cat $IN_FILE
21+
22+
if [[ -f "$IN_FILE" ]]; then
23+
NUM_ISSUES=$(jq '.Issues | length' "$IN_FILE")
2124
echo "$NUM_ISSUES"
2225

2326
if [[ "$NUM_ISSUES" -ge 1 ]]; then
24-
MSG="`jq -r '.Issues[0].Text' "$LINT_FILE"`"
27+
MSG="`jq -r '.Issues[0].Text' "$IN_FILE"`"
2528
echo
2629
fi
2730
fi
2831

29-
echo "{\"start_at\": \"$START_TIME\", \"end_at\": \"$END_TIME\", \"duration_seconds\": \"$DURATION\", \"result\": \"$RESULT\", \"msg\": \"$MSG\"}" > $LINT_FILE
32+
echo "{\"start_at\": \"$START_TIME\", \"end_at\": \"$END_TIME\", \"duration_seconds\": \"$DURATION\", \"result\": \"$RESULT\", \"msg\": \"$MSG\"}" > $OUT_FILE

src/core/process_test.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,30 @@ func TestCheckForProcesses(t *testing.T) {
3636
procsToCheck: []string{},
3737
expMissingProcs: []string{},
3838
},
39-
//{
40-
// testName: "SingleProcessFound",
41-
// procsToCreate: []string{fakeProcOne},
42-
// procsToCheck: []string{fakeProcOne},
43-
// expMissingProcs: []string{},
44-
//},
45-
//{
46-
// testName: "MultipleProcessesFound",
47-
// procsToCreate: []string{fakeProcOne, fakeProcTwo, fakeProcThree},
48-
// procsToCheck: []string{fakeProcOne, fakeProcTwo, fakeProcThree},
49-
// expMissingProcs: []string{},
50-
//},
51-
//{
52-
// testName: "SingleMissingProcess",
53-
// procsToCreate: []string{fakeProcOne, fakeProcThree},
54-
// procsToCheck: []string{fakeProcOne, fakeProcTwo, fakeProcThree},
55-
// expMissingProcs: []string{fakeProcTwo},
56-
//},
57-
//{
58-
// testName: "MultipleMissingProcesses",
59-
// procsToCreate: []string{fakeProcTwo},
60-
// procsToCheck: []string{fakeProcOne, fakeProcTwo, fakeProcThree},
61-
// expMissingProcs: []string{fakeProcOne, fakeProcThree},
62-
//},
39+
{
40+
testName: "SingleProcessFound",
41+
procsToCreate: []string{fakeProcOne},
42+
procsToCheck: []string{fakeProcOne},
43+
expMissingProcs: []string{},
44+
},
45+
{
46+
testName: "MultipleProcessesFound",
47+
procsToCreate: []string{fakeProcOne, fakeProcTwo, fakeProcThree},
48+
procsToCheck: []string{fakeProcOne, fakeProcTwo, fakeProcThree},
49+
expMissingProcs: []string{},
50+
},
51+
{
52+
testName: "SingleMissingProcess",
53+
procsToCreate: []string{fakeProcOne, fakeProcThree},
54+
procsToCheck: []string{fakeProcOne, fakeProcTwo, fakeProcThree},
55+
expMissingProcs: []string{fakeProcTwo},
56+
},
57+
{
58+
testName: "MultipleMissingProcesses",
59+
procsToCreate: []string{fakeProcTwo},
60+
procsToCheck: []string{fakeProcOne, fakeProcTwo, fakeProcThree},
61+
expMissingProcs: []string{fakeProcOne, fakeProcThree},
62+
},
6363
}
6464

6565
for _, tc := range testCases {

0 commit comments

Comments
 (0)