Skip to content

Commit

Permalink
Add a stability warning to make build and create make build-tests. (#…
Browse files Browse the repository at this point in the history
…1900)

* Create the build-tests make target.

* Add a github action that just builds the tests.

* Add a warning and delay to the build make target.

* Tweak the warning to just say this branch instead of specifying one.
  • Loading branch information
SpicyLemon authored Apr 2, 2024
1 parent 0bd746c commit b5f9598
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ jobs:
name: "${{ needs.setup-tests.outputs.file-prefix }}-${{ matrix.part }}-coverage"
path: ./${{ matrix.part }}profile.out

build-tests:
# TODO[1760]: Delete this build-tests action once the tests reliably pass again.
needs: setup-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
if: needs.setup-tests.outputs.should-run
with:
go-version: ${{ needs.setup-tests.outputs.go-version }}
- name: build tests
run: |
make build-tests
# This action performs a code coverage assessment but filters out generated code from proto based types
# and grpc services
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ install: go.sum
CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install $(BUILD_FLAGS) ./cmd/provenanced

build: validate-go-version go.sum
# TODO[1760]: Remove this delay once we're stable again.
@if [ -z "${ACK_50}" ]; then printf '\033[93mWARNING:\033[0m This branch is currently unstable and should not be built for use.\n To bypass this 10 second delay: ACK_50=1 make build\n'; sleep 10; fi
mkdir -p $(BUILDDIR)
CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build -o $(BUILDDIR)/ $(BUILD_FLAGS) ./cmd/provenanced

Expand Down Expand Up @@ -353,18 +355,25 @@ $(CHECK_TEST_TARGETS): run-tests

run-tests: go.sum
ifneq (,$(shell which tparse 2>/dev/null))
$(GO) test -mod=readonly -json $(ARGS) -tags='$(TAGS)'$(TEST_PACKAGES) | tparse
$(GO) test -mod=readonly -json $(ARGS) -tags='$(TAGS)' $(TEST_PACKAGES) | tparse
else
$(GO) test -mod=readonly $(ARGS) -tags='$(TAGS)' $(TEST_PACKAGES)
endif

build-tests: go.sum
ifneq (,$(shell which tparse 2>/dev/null))
$(GO) test -mod=readonly -json $(ARGS) -tags='$(TAGS)' -run='ZYX_NOPE_NOPE_XYZ' $(TEST_PACKAGES) | tparse
else
$(GO) test -mod=readonly $(ARGS) -tags='$(TAGS)' -run='ZYX_NOPE_NOPE_XYZ' $(TEST_PACKAGES)
endif

test-cover:
export VERSION=$(VERSION); bash -x contrib/test_cover.sh

benchmark:
$(GO) test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION)

.PHONY: test test-all test-unit test-race test-cover benchmark run-tests $(TEST_TARGETS)
.PHONY: test test-all test-unit test-race test-cover benchmark run-tests build-tests $(TEST_TARGETS)

##############################
# Test Network Targets
Expand Down

0 comments on commit b5f9598

Please sign in to comment.