From 5b53252033c3e2b90ed8ecffbb148e6fcbecfb9e Mon Sep 17 00:00:00 2001 From: Igor Gov Date: Mon, 7 Feb 2022 07:16:28 +0200 Subject: [PATCH] CI: test share module (#763) --- .github/workflows/test.yml | 31 ++++++++++--------------------- Makefile | 3 +++ shared/Makefile | 2 ++ 3 files changed, 15 insertions(+), 21 deletions(-) create mode 100644 shared/Makefile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb207129e..7ec45bf46 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,26 +15,8 @@ concurrency: cancel-in-progress: true jobs: - run-tests-cli: - name: CLI Tests - runs-on: ubuntu-latest - steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v2 - with: - go-version: '^1.16' - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Test - run: make test-cli - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - - run-tests-agent: - name: Agent Tests + run-unit-tests: + name: Unit Tests runs-on: ubuntu-latest steps: - name: Set up Go 1.16 @@ -49,8 +31,15 @@ jobs: run: | sudo apt-get install libpcap-dev - - name: Test + - name: CLI Test + run: make test-cli + + - name: Agent Test run: make test-agent + + - name: Shared Test + run: make test-shared - name: Upload coverage to Codecov uses: codecov/codecov-action@v2 + diff --git a/Makefile b/Makefile index 5f38c6094..289b85e68 100644 --- a/Makefile +++ b/Makefile @@ -89,5 +89,8 @@ test-cli: test-agent: @echo "running agent tests"; cd agent && $(MAKE) test +test-shared: + @echo "running shared tests"; cd shared && $(MAKE) test + acceptance-test: @echo "running acceptance tests"; cd acceptanceTests && $(MAKE) test diff --git a/shared/Makefile b/shared/Makefile new file mode 100644 index 000000000..a11ca77a3 --- /dev/null +++ b/shared/Makefile @@ -0,0 +1,2 @@ +test: ## Run shared tests. + @go test ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic \ No newline at end of file