Skip to content

Commit

Permalink
remove redundant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xavpaice committed Nov 7, 2024
1 parent 544a700 commit e467ae7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 122 deletions.
112 changes: 3 additions & 109 deletions .github/workflows/build-test-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,6 @@ jobs:
- name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass.
run: exit 1

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: setup env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- name: Run linters
run: make install-golangci-lint lint
- name: Run tests
run: make test

test-integration:
runs-on: ubuntu-latest
steps:
Expand All @@ -63,8 +44,8 @@ jobs:
- uses: replicatedhq/action-k3s@main
id: k3s
with:
version: v1.24.1-k3s1

version: v1.31.2+k3s1
# test-integration includes unit tests
- run: make test-integration

ensure-schemas-are-generated:
Expand Down Expand Up @@ -104,54 +85,6 @@ jobs:
name: preflight
path: bin/preflight

validate-preflight:
runs-on: ubuntu-latest
needs: compile-preflight
steps:
- uses: replicatedhq/action-k3s@main
id: k3s
with:
version: v1.23.6-k3s1
- name: Download preflight binary
uses: actions/download-artifact@v4
with:
name: preflight
path: bin/
- run: chmod +x bin/preflight
- run: |
set +e
./bin/preflight --interactive=false --format=json https://preflight.replicated.com > result.json
EXIT_CODE=$?
cat result.json
EXIT_STATUS=0
if [ $EXIT_CODE -ne 3 ]; then
echo "Expected exit code of 3 (some checks failed), got $EXIT_CODE"
EXIT_STATUS=1
fi
if grep -q "was not collected" result.json; then
echo "Some files were not collected"
EXIT_STATUS=1
fi
if (( `jq '.pass | length' result.json` < 1 )); then
echo "No passing preflights found"
EXIT_STATUS=1
fi
if (( `jq '.warn | length' result.json` < 1 )); then
echo "No warnings found"
EXIT_STATUS=1
fi
if (( `jq '.fail | length' result.json` < 1 )); then
echo "No failed preflights found"
EXIT_STATUS=1
fi
exit $EXIT_STATUS
validate-preflight-e2e:
runs-on: ubuntu-latest
needs: compile-preflight
Expand Down Expand Up @@ -193,25 +126,6 @@ jobs:
name: support-bundle
path: bin/support-bundle

validate-supportbundle:
runs-on: ubuntu-latest
needs: compile-supportbundle
steps:
- uses: actions/checkout@v4
- uses: replicatedhq/action-k3s@main
id: k3s
with:
version: v1.23.6-k3s1
- name: Download support-bundle binary
uses: actions/download-artifact@v4
with:
name: support-bundle
path: bin/
- run: chmod +x bin/support-bundle
- run: ./bin/support-bundle ./examples/support-bundle/sample-collectors.yaml
- run: ./bin/support-bundle ./examples/support-bundle/sample-supportbundle.yaml
- run: ./bin/support-bundle https://kots.io

validate-supportbundle-e2e:
runs-on: ubuntu-latest
needs: compile-supportbundle
Expand All @@ -220,34 +134,14 @@ jobs:
- uses: replicatedhq/action-k3s@main
id: k3s
with:
version: v1.23.6-k3s1
version: v1.31.2+k3s1
- name: Download support bundle binary
uses: actions/download-artifact@v4
with:
name: support-bundle
path: bin/
- run: chmod +x bin/support-bundle
- run: make support-bundle-e2e-test

validate-supportbundle-e2e-go-test:
runs-on: ubuntu-latest
needs: compile-supportbundle
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: setup env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- uses: actions/checkout@v4
- name: Download support bundle binary
uses: actions/download-artifact@v4
with:
name: support-bundle
path: bin/
- run: chmod +x bin/support-bundle
- run: make support-bundle-e2e-go-test

compile-collect:
Expand Down
14 changes: 1 addition & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test: generate fmt vet
# TODOLATER: merge with test, so we get unified coverage reports? it'll add 21~sec to the test job though...
.PHONY: test-integration
test-integration:
go test -v --tags "integration exclude_graphdriver_devicemapper exclude_graphdriver_btrfs" ${BUILDPATHS}
go test -v --tags="integration exclude_graphdriver_devicemapper exclude_graphdriver_btrfs" ${BUILDPATHS}

.PHONY: preflight-e2e-test
preflight-e2e-test:
Expand Down Expand Up @@ -237,18 +237,6 @@ scan:
--ignore-unfixed \
./

.PHONY: lint
lint: vet
golangci-lint run --new -c .golangci.yaml --build-tags ${BUILDTAGS} ${BUILDPATHS}

.PHONY: lint-and-fix
lint-and-fix: fmt vet
golangci-lint run --new --fix -c .golangci.yaml --build-tags ${BUILDTAGS} ${BUILDPATHS}

.PHONY: install-golangci-lint
install-golangci-lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}

.PHONY: watch
watch: npm-install
bin/watch.js
Expand Down

0 comments on commit e467ae7

Please sign in to comment.