Skip to content

Commit abdda05

Browse files
David WertenteilYuval Leibovich
andauthored
* test Signed-off-by: David Wertenteil <[email protected]> * adding to PR review Signed-off-by: David Wertenteil <[email protected]> * fixed race testing Signed-off-by: David Wertenteil <[email protected]> * fixing coverage function * fixing coverage function in pr.yaml --------- Signed-off-by: David Wertenteil <[email protected]> Co-authored-by: Yuval Leibovich <[email protected]>
1 parent 6f42784 commit abdda05

File tree

3 files changed

+30
-18
lines changed

3 files changed

+30
-18
lines changed

.github/workflows/pr.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,22 @@ jobs:
1717
uses: actions/setup-go@v2
1818
with:
1919
go-version: 1.19
20-
21-
- name: Test
22-
env:
23-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Test race
2422
run: go test -v -race ./...
25-
23+
24+
- name: Test units
25+
run: go test -v ./... -covermode=count -coverprofile=coverage.out
26+
27+
- name: Convert coverage to lcov
28+
uses: jandelgado/gcov2lcov-action@v1
29+
30+
- name: Coveralls
31+
uses: coverallsapp/github-action@v1
32+
with:
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
path-to-lcov: coverage.lcov
35+
2636
- name: Build
2737
run: go build -v ./...
2838

.github/workflows/release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
- name: Test
2020
run: go test -v ./... -covermode=count -coverprofile=coverage.out
2121

22+
- name: Convert coverage to lcov
23+
uses: jandelgado/gcov2lcov-action@v1
24+
2225
- name: Coveralls
2326
uses: coverallsapp/github-action@v1
2427
with:

reporthandling/datastructures.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,18 @@ type PolicyRule struct {
5353

5454
// Control represents a collection of rules which are combined together to single purpose
5555
type Control struct {
56-
armotypes.PortalBase `json:",inline" bson:"inline"`
57-
Control_ID string `json:"id,omitempty" bson:"id,omitempty" ` // to be Deprecated
58-
ControlID string `json:"controlID" bson:"controlID"`
59-
CreationTime string `json:"creationTime" bson:"creationTime"`
60-
Description string `json:"description" bson:"description"`
61-
Remediation string `json:"remediation" bson:"remediation"`
62-
Rules []PolicyRule `json:"rules" bson:"rules,omitempty"`
63-
FrameworkNames []string `json:"frameworkNames,omitempty" bson:"frameworkNames,omitempty"` // frameworks this control is part of
64-
FixedInput map[string][]string `json:"fixedInput,omitempty"` // DEPRECATED
65-
// for new list of rules in POST/UPADTE requests
66-
RulesIDs *[]string `json:"rulesIDs,omitempty" bson:"rulesIDs,omitempty"`
67-
BaseScore float32 `json:"baseScore,omitempty" bson:"baseScore,omitempty"`
68-
ARMOImprovementFactor float32 `json:"ARMOImprovementFactor,omitempty" bson:"ARMOImprovementFactor,omitempty"`
56+
FixedInput map[string][]string `json:"fixedInput,omitempty"`
57+
RulesIDs *[]string `json:"rulesIDs,omitempty" bson:"rulesIDs,omitempty"`
58+
armotypes.PortalBase `json:",inline" bson:"inline"`
59+
Control_ID string `json:"id,omitempty" bson:"id,omitempty" `
60+
ControlID string `json:"controlID" bson:"controlID"`
61+
CreationTime string `json:"creationTime" bson:"creationTime"`
62+
Description string `json:"description" bson:"description"`
63+
Remediation string `json:"remediation" bson:"remediation"`
64+
Rules []PolicyRule `json:"rules" bson:"rules,omitempty"`
65+
FrameworkNames []string `json:"frameworkNames,omitempty" bson:"frameworkNames,omitempty"`
66+
BaseScore float32 `json:"baseScore,omitempty" bson:"baseScore,omitempty"`
67+
ARMOImprovementFactor float32 `json:"ARMOImprovementFactor,omitempty" bson:"ARMOImprovementFactor,omitempty"`
6968
}
7069

7170
type UpdatedControl struct {

0 commit comments

Comments
 (0)