From bdcbd0abd34222b0fa6de99b948d2c5f715246f5 Mon Sep 17 00:00:00 2001 From: Ilya Bygrimov Date: Sat, 16 Nov 2024 00:58:36 +0100 Subject: [PATCH] Edit wf file --- .github/workflows/ci.yaml | 20 ++++++++++++++++---- Makefile | 2 +- tests/galacli/Makefile | 25 +++++++++++++++++-------- tests/galacli/pyproject.toml | 2 +- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 649de06..2a8b5b4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,7 +47,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Download binary artifact uses: actions/download-artifact@v4 with: @@ -59,11 +59,23 @@ jobs: version: "latest" - name: Run tests - run: make test + run: | + make test + if [ -f "report.md" ]; then + echo "
Failed Test Report" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + cat report.md >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "
" >> $GITHUB_STEP_SUMMARY + fi - - name: Test status check + - name: Render the report to the PR when tests fail + uses: marocchino/sticky-pull-request-comment@v2 if: failure() - run: exit 1 + with: + header: test-report + recreate: true + path: ${{ env.REPORT_FILE }} permissions: pull-requests: write diff --git a/Makefile b/Makefile index 4b86891..8166d27 100644 --- a/Makefile +++ b/Makefile @@ -127,7 +127,7 @@ build-alpine: @GOOS=linux CGO_ENABLED=1 go build -ldflags="-w -s" -o $(BUILDDIR)/$(GALACTICA_BINARY) ./cmd/galacticad localnet-build: - @make build + @$(MAKE) build @echo "Build docker image for localnet..." @./localnet/build-docker.sh diff --git a/tests/galacli/Makefile b/tests/galacli/Makefile index c7c0ee2..1129442 100644 --- a/tests/galacli/Makefile +++ b/tests/galacli/Makefile @@ -1,28 +1,37 @@ uname=$(shell uname -s) is_darwin :=$(filter Darwin,$(uname)) +all: ## run tests +all: $(if $(is_darwin),network,) clean start_test -all: $(if $(is_darwin),network,) clean start +help: ## Show this help + @printf "\033[33m%s:\033[0m\n" 'Available commands' + @awk 'BEGIN {FS = ":.*?## "} /^[[:alpha:][:punct:]]+:.*?## / {printf " \033[32m%-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) clean: rm -rf node0* .pytest_cache __pycache__ -.venv/bin/python: +.venv/bin/pytest .venv/bin/python: uv venv uv sync +start: ## just run galacli.py for debugging purpose start: .venv/bin/python - pytest -v . -# .venv/bin/python galacli.py -ps: + .venv/bin/python galacli.py + +start_test: .venv/bin/pytest ## start tests + .venv/bin/pytest -v . + +ps: ## show running galacticad processes -@ps | grep galacticad | grep -v 'grep' -terminate: ps +terminate: ps ## terminate running galacticad processes ps | grep galacticad | grep -v 'grep' | awk '{print $$1}' | xargs -n1 kill -15 -kill: ps + +kill: ps ## kill running galacticad processes ps | grep galacticad | grep -v 'grep' | awk '{print $$1}' | xargs -n1 sudo kill -9 ifeq ($(uname),Darwin) -network: /tmp/127.0.0.2 /tmp/127.0.0.3 /tmp/127.0.0.4 +network: /tmp/127.0.0.2 /tmp/127.0.0.3 /tmp/127.0.0.4 ## assume you are using macos for development /tmp/127.0.0.%: sudo ifconfig lo0 alias $(shell basename $@) up && touch $@ endif diff --git a/tests/galacli/pyproject.toml b/tests/galacli/pyproject.toml index 5d62a8c..a37c658 100644 --- a/tests/galacli/pyproject.toml +++ b/tests/galacli/pyproject.toml @@ -19,7 +19,7 @@ dependencies = [ [tool.pytest.ini_options] md_report_output = "report.md" md_report = true -md_report_verbose = 0 +md_report_verbose = 1 md_report_color = "never" # asyncio_mode = "auto"