Skip to content

Commit ec8d685

Browse files
committed
Add new embedded parser
This parser was created to handle cases where we have a testsuite nested in another testsuite. Fix prevents duplicated testsuites
1 parent e484b8c commit ec8d685

File tree

11 files changed

+438
-40
lines changed

11 files changed

+438
-40
lines changed

.semaphore/goreleaser.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "v1.0"
1+
version: v1.0
22
name: GoReleaser
33
agent:
44
machine:
@@ -16,4 +16,4 @@ blocks:
1616
jobs:
1717
- name: goreleaser
1818
commands:
19-
- curl -sL https://git.io/goreleaser | VERSION=v1.18.2 bash
19+
- 'curl -sL https://git.io/goreleaser | VERSION=v1.18.2 bash'

.semaphore/integration.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,23 @@ blocks:
1717
dependencies: []
1818
task:
1919
jobs:
20-
- name: "Parsers"
20+
- name: Parsers
2121
matrix:
22-
- env_var: PARSER
23-
values: ["generic", "rspec", "golang", "exunit", "phpunit"]
22+
- env_var: PARSER
23+
values:
24+
- generic
25+
- rspec
26+
- golang
27+
- exunit
28+
- phpunit
29+
- embedded
2430
commands:
2531
- test-results publish priv/parsers/$PARSER/in.xml
2632
- artifact pull job test-results/junit.json -d /tmp/junit.json
2733
- cat <<< $(jq --sort-keys . priv/parsers/$PARSER/out.json) > priv/parsers/$PARSER/out.json
2834
- cat <<< $(jq --sort-keys . /tmp/junit.json) > /tmp/junit.json
2935
- diff priv/parsers/$PARSER/out.json /tmp/junit.json
30-
31-
- name: "Merging - directory as input"
36+
- name: Merging - directory as input
3237
commands:
3338
- test-results publish priv/merging
3439
- artifact pull job test-results/junit.json -d /tmp/junit.json
@@ -40,33 +45,31 @@ blocks:
4045
- Integration tests
4146
task:
4247
jobs:
43-
- name: "generate pipeline report"
48+
- name: generate pipeline report
4449
commands:
4550
- test-results gen-pipeline-report
46-
4751
- name: Integration tests - workflow level
4852
dependencies:
4953
- Integration tests - generate pipeline report
5054
task:
5155
jobs:
52-
- name: "Generate pipeline report"
56+
- name: Generate pipeline report
5357
commands:
54-
- artifact pull workflow test-results/${SEMAPHORE_PIPELINE_ID}.json -d /tmp/junit.json
58+
- 'artifact pull workflow test-results/${SEMAPHORE_PIPELINE_ID}.json -d /tmp/junit.json'
5559
- artifact push job /tmp/junit.json -d test-results/junit.json
5660
- cat <<< $(jq --sort-keys . priv/workflow/out.json) > priv/workflow/out.json
5761
- cat <<< $(jq --sort-keys . /tmp/junit.json) > /tmp/junit.json
5862
- diff /tmp/junit.json priv/workflow/out.json
59-
- name: "Generate pipeline summary"
63+
- name: Generate pipeline summary
6064
commands:
61-
- artifact pull workflow test-results/${SEMAPHORE_PIPELINE_ID}-summary.json -d /tmp/summary.json
65+
- 'artifact pull workflow test-results/${SEMAPHORE_PIPELINE_ID}-summary.json -d /tmp/summary.json'
6266
- cat <<< $(jq --sort-keys . priv/workflow/summary-out.json) > priv/workflow/summary-out.json
6367
- cat <<< $(jq --sort-keys . /tmp/summary.json) > /tmp/summary.json
6468
- diff /tmp/summary.json priv/workflow/summary-out.json
65-
6669
promotions:
6770
- name: Release
6871
pipeline_file: goreleaser.yml
6972
auto_promote_on:
7073
- result: passed
7174
branch:
72-
- "^refs/tags/v*"
75+
- ^refs/tags/v*

.semaphore/semaphore.yml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ agent:
44
machine:
55
type: e1-standard-2
66
os_image: ubuntu2004
7-
87
blocks:
98
- name: Unit tests
109
dependencies: []
@@ -15,71 +14,62 @@ blocks:
1514
- checkout
1615
- go mod download
1716
- go install gotest.tools/gotestsum@latest
18-
1917
jobs:
20-
- name: 🧪 Go tests
18+
- name: "\U0001F9EA Go tests"
2119
commands:
22-
- export SUITE_NAME="🧪 Go tests"
20+
- "export SUITE_NAME=\"\U0001F9EA Go tests\""
2321
- gotestsum --junitfile results.xml
24-
2522
epilogue:
2623
always:
2724
commands:
28-
- "[[ -f results.xml ]] && test-results publish --name \"$SUITE_NAME\" results.xml"
29-
25+
- '[[ -f results.xml ]] && test-results publish --name "$SUITE_NAME" results.xml'
3026
- name: Security checks
3127
dependencies: []
3228
task:
3329
secrets:
3430
- name: security-toolbox-shared-read-access
35-
3631
prologue:
3732
commands:
3833
- checkout
3934
- mv ~/.ssh/security-toolbox ~/.ssh/id_rsa
4035
- sudo chmod 600 ~/.ssh/id_rsa
41-
4236
jobs:
43-
- name: 🛡️ Check dependencies
37+
- name: "\U0001F6E1 Check dependencies"
4438
commands:
45-
- export SUITE_NAME="🛡️ Check dependencies"
39+
- "export SUITE_NAME=\"\U0001F6E1 Check dependencies\""
4640
- make check.deps
47-
48-
- name: 🛡️ Check code
41+
- name: "\U0001F6E1️ Check code"
4942
commands:
50-
- export SUITE_NAME="🛡️ Check code"
43+
- "export SUITE_NAME=\"\U0001F6E1 Check code\""
5144
- make check.static
52-
5345
epilogue:
5446
always:
5547
commands:
56-
- "[[ -f results.xml ]] && test-results publish --name \"$SUITE_NAME\" results.xml"
57-
48+
- '[[ -f results.xml ]] && test-results publish --name "$SUITE_NAME" results.xml'
5849
- name: Build
59-
dependencies: ["Security checks", "Unit tests"]
50+
dependencies:
51+
- Security checks
52+
- Unit tests
6053
task:
6154
prologue:
6255
commands:
6356
- sem-version go 1.18
6457
- checkout
6558
- go mod download
6659
- go install gotest.tools/gotestsum@latest
67-
6860
jobs:
69-
- name: 🏗️ Build binary
61+
- name: "\U0001F3D7 Build binary"
7062
commands:
7163
- make build
7264
- artifact push workflow bin/test-results -d bin/test-results
73-
7465
after_pipeline:
7566
task:
7667
jobs:
7768
- name: Submit Reports
7869
commands:
7970
- test-results gen-pipeline-report
80-
8171
promotions:
8272
- name: Integration tests
8373
pipeline_file: integration.yml
8474
auto_promote:
85-
when: "result = 'passed'"
75+
when: result = 'passed'

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ regen:
99
go run main.go compile priv/parsers/exunit/in.xml priv/parsers/exunit/out.json
1010
go run main.go compile priv/parsers/golang/in.xml priv/parsers/golang/out.json
1111
go run main.go compile priv/parsers/phpunit/in.xml priv/parsers/phpunit/out.json
12+
go run main.go compile priv/parsers/embedded/in.xml priv/parsers/embedded/out.json
1213
go run main.go compile priv/merging priv/merging/out.json
1314
go run main.go compile priv/merging priv/parsers priv/workflow/out.json
1415

pkg/cli/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func WriteToFile(data []byte, file *os.File) (string, error) {
197197
return writeToFile(data, file)
198198
}
199199

200-
// WriteToFilePathPath saves data to given file
200+
// WriteToFilePath saves data to given file
201201
func WriteToFilePath(data []byte, path string) (string, error) {
202202
file, err := os.Create(path) // #nosec
203203
defer file.Close()

0 commit comments

Comments
 (0)