-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into google_chrome_profiles_add_path_col
- Loading branch information
Showing
4 changed files
with
100 additions
and
27 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,29 +1,16 @@ | ||
name: Test Coverage | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
coverage: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Test Coverage | ||
run: make coverage | ||
|
||
- name: Setup LCOV | ||
uses: hrishikesh-kadam/setup-lcov@d100c36c45e4f64950fb746cd28713f6c756a9c1 | ||
- name: Report code coverage | ||
uses: zgosalvez/github-actions-report-lcov@5f5c6e77851c41ab9c69a212690c1040bb916016 | ||
- name: generate test coverage | ||
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./... | ||
- name: check test coverage | ||
uses: vladopajic/go-test-coverage@v2 | ||
with: | ||
coverage-files: coverage/lcov.info | ||
minimum-coverage: 40 | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
update-comment: true | ||
config: ./.testcoverage.yml |
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ macadmins_extension | |
config.mk | ||
bazel-* | ||
coverage/* | ||
version_config.go | ||
version_config.go | ||
cover.out |
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,82 @@ | ||
# (mandatory) | ||
# Path to coverage profile file (output of `go test -coverprofile` command). | ||
# | ||
# For cases where there are many coverage profiles, such as when running | ||
# unit tests and integration tests separately, you can combine all those | ||
# profiles into one. In this case, the profile should have a comma-separated list | ||
# of profile files, e.g., 'cover_unit.out,cover_integration.out'. | ||
profile: cover.out | ||
|
||
# (optional; but recommended to set) | ||
# When specified reported file paths will not contain local prefix in the output. | ||
local-prefix: "github.com/macadmins/osquery-extension" | ||
|
||
# Holds coverage thresholds percentages, values should be in range [0-100]. | ||
threshold: | ||
# (optional; default 0) | ||
# Minimum coverage percentage required for individual files. | ||
file: 40 | ||
|
||
# (optional; default 0) | ||
# Minimum coverage percentage required for each package. | ||
package: 40 | ||
|
||
# (optional; default 0) | ||
# Minimum overall project coverage percentage required. | ||
total: 40 | ||
|
||
# Holds regexp rules which will override thresholds for matched files or packages | ||
# using their paths. | ||
# | ||
# First rule from this list that matches file or package is going to apply | ||
# new threshold to it. If project has multiple rules that match same path, | ||
# override rules should be listed in order from specific to more general rules. | ||
override: | ||
- path: tables/filevaultusers/filevaultusers.go | ||
threshold: 36 | ||
- path: tables/macos_profiles/macos_profiles.go | ||
threshold: 36 | ||
- path: tables/sofa/sofa_cves.go | ||
threshold: 26 | ||
- path: ^tables/macos_profiles$ | ||
threshold: 36 | ||
- path: ^tables/filevaultusers$ | ||
threshold: 36 | ||
- path: ^tables/mdm$ | ||
threshold: 38 | ||
- path: tables/mdm/mdm.go | ||
threshold: 38 | ||
# Holds regexp rules which will exclude matched files or packages | ||
# from coverage statistics. | ||
exclude: | ||
# Exclude files or packages matching their paths | ||
paths: | ||
- main.go | ||
- pkg/utils/exec.go | ||
- tables/fileline/file_line.go | ||
- tables/unifiedlog/unified_log.go | ||
- ^tables/networkquality$ | ||
- ^tables/unifiedlog$ | ||
- ^tables/puppet$ | ||
- ^tables/unifiedlog$ | ||
- ^tables/pendingappleupdates$ | ||
- ^tables/fileline$ | ||
- tables/unifiedlog/unified_log.go | ||
- tables/networkquality/networkquality.go | ||
- tables/pendingappleupdates/pendingappleupdates.go | ||
- tables/puppet/puppet_facts.go | ||
- tables/puppet/puppet_info.go | ||
- tables/puppet/puppet_logs.go | ||
- tables/puppet/puppet_state.go | ||
- tables/puppet/yaml.go | ||
# - \.pb\.go$ # excludes all protobuf generated files | ||
# - ^pkg/bar # exclude package `pkg/bar` | ||
|
||
# File name of go-test-coverage breakdown file, which can be used to | ||
# analyze coverage difference. | ||
breakdown-file-name: "" | ||
|
||
diff: | ||
# File name of go-test-coverage breakdown file which will be used to | ||
# report coverage difference. | ||
base-breakdown-file-name: "" |
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