Skip to content

Commit

Permalink
split unit and integration tests runs
Browse files Browse the repository at this point in the history
This allows running unit tests without sudo.
  • Loading branch information
kdomanski committed Sep 17, 2022
1 parent ac741c8 commit 2c55b0f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ jobs:
- name: Build
run: go build -v .

- name: Unit tests
run: go test -v -coverprofile=coverage_unit.txt -covermode=atomic .

- name: Integration test
# The test need sudo to be able to mount/umount
run: sudo go test -v --tags=integration -coverprofile=coverage.txt -covermode=atomic .
run: sudo go test -v --tags=integration -coverprofile=coverage_integration.txt -covermode=atomic .

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage_unit.txt,coverage_integration.txt
3 changes: 3 additions & 0 deletions image_reader_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !integration
// +build !integration

package iso9660

import (
Expand Down
3 changes: 3 additions & 0 deletions image_writer_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !integration
// +build !integration

package iso9660

import (
Expand Down
3 changes: 3 additions & 0 deletions iso9660_datatypes_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !integration
// +build !integration

package iso9660

import (
Expand Down
3 changes: 3 additions & 0 deletions iso9660_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !integration
// +build !integration

package iso9660

import (
Expand Down

0 comments on commit 2c55b0f

Please sign in to comment.