Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6e01cf3
fix permissions
Cerebrovinny Feb 28, 2025
4f35b25
codecov
Cerebrovinny Feb 28, 2025
95d9ff3
Implement PR Size Labeler (#1098)
Cerebrovinny Feb 28, 2025
8ec7ce0
Use Mergify for PR Size Comments (#1099)
Cerebrovinny Feb 28, 2025
5ac750d
Merge remote-tracking branch 'origin/main'
Cerebrovinny Mar 1, 2025
565bb61
Merge branch 'main' into DEV-3070
Cerebrovinny Mar 1, 2025
d6e170a
fix: coverage run
Cerebrovinny Mar 1, 2025
8cdd73e
clean up codecov
Cerebrovinny Mar 1, 2025
6986797
fix path
Cerebrovinny Mar 1, 2025
0c1ef7b
add comment
Cerebrovinny Mar 1, 2025
793a7f6
add comment
Cerebrovinny Mar 1, 2025
0f582d1
fix path debug
Cerebrovinny Mar 1, 2025
e3bb2aa
fix path part 2
Cerebrovinny Mar 1, 2025
4c17445
test config cov
Cerebrovinny Mar 1, 2025
4383c28
test config cov
Cerebrovinny Mar 1, 2025
c4e08f4
test config cov
Cerebrovinny Mar 1, 2025
c546f85
Merge branch 'main' into DEV-3070
Cerebrovinny Mar 1, 2025
17fcb40
test config cov
Cerebrovinny Mar 1, 2025
054f944
test codecov config
Cerebrovinny Mar 1, 2025
51f3734
update ci
Cerebrovinny Mar 1, 2025
213a62e
Update codecov.yml
Cerebrovinny Mar 2, 2025
e00d94b
remove coverage file
Cerebrovinny Mar 2, 2025
55cabff
unify tests
Cerebrovinny Mar 2, 2025
4bab781
fix action codecov issue
Cerebrovinny Mar 2, 2025
dd98eed
Update codecov.yml
Cerebrovinny Mar 2, 2025
67c5823
Update .github/workflows/test.yml
osterman Mar 2, 2025
7c5e947
Update test.yml
osterman Mar 2, 2025
2fcbd6a
Update test.yml
osterman Mar 2, 2025
c397ada
Update codecov.yml
osterman Mar 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,46 @@ jobs:
path: |
./build/

coverage:
name: Test Coverage
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts-linux
path: ${{ github.workspace }}

- name: Add build artifacts to PATH
run: |
echo "${{ github.workspace }}" >> $GITHUB_PATH
chmod +x "${{ github.workspace }}/atmos"
atmos version

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
id: go

- name: Get dependencies
run: make deps

- name: Run tests with coverage
run: make testacc-cover

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.out
fail_ci_if_error: true
flags: unittests
verbose: true

# run acceptance tests
test:
name: Acceptance Tests
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@
# Ignore components vendored during tests
tests/fixtures/scenarios/vendor/components/**
examples/demo-vendoring/components/**

# Coverage files
coverage.out
coverage.html
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,16 @@ version-windows: build-windows
deps:
go mod download

# Run acceptance tests
testacc: get
go test $(TEST) -v $(TESTARGS) -timeout 10m
@echo "Running acceptance tests"
go test $(TEST) -v $(TESTARGS) -timeout 10m -coverprofile=coverage.out

.PHONY: lint get build version build-linux build-windows build-macos deps version-linux version-windows version-macos testacc
testacc-cover: get
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the harm in always running with coverage enabled? Want to understand if a separate target is needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I decided to split it to maintain the same behavior as before locally. I don’t think it makes a difference in CI, so we can keep it. The only downside I see is if we don’t need coverage locally

@echo "Running tests with coverage"
go test $(TEST) -v $(TESTARGS) -timeout 10m -coverprofile=coverage.out

# Run acceptance tests with coverage report
testacc-coverage: testacc-cover
go tool cover -html=coverage.out -o coverage.html

.PHONY: lint get build version build-linux build-windows build-macos deps version-linux version-windows version-macos testacc testacc-cover testacc-coverage
12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
coverage:
precision: 2
round: down
range: "70...100"

status:
patch:
default:
target: 80% # Require at least 80% test coverage on new/changed lines
threshold: 2% # Allow a small drop in coverage
base: auto
informational: false # Fail the PR check if coverage is too low
Loading