From 6d5c77b85049234950e16e18cb50a144a4f9a2a4 Mon Sep 17 00:00:00 2001 From: m1ngsama Date: Sat, 23 May 2026 21:26:19 +0800 Subject: [PATCH] ci: make integration tests strict --- .github/workflows/deploy.yml | 30 ------------------------------ Makefile | 12 ++++++++++-- README.md | 3 ++- docs/CHANGELOG.md | 4 ++++ docs/CICD.md | 2 +- docs/Development-Guide.md | 3 ++- 6 files changed, 19 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 74eb204..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: CI - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y expect libssh-dev - - - name: Build - run: make - - - name: Build with AddressSanitizer - run: make asan - - - name: Run tests - run: | - make test - cd tests - ./test_security_features.sh diff --git a/Makefile b/Makefile index 4fd8e42..118e75c 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ BINDIR ?= $(PREFIX)/bin MANDIR ?= $(PREFIX)/share/man SYSTEMD_UNIT_DIR ?= $(PREFIX)/lib/systemd/system -.PHONY: all clean install install-systemd uninstall uninstall-systemd debug release release-check release-check-strict asan valgrind check test unit-test info +.PHONY: all clean install install-systemd uninstall uninstall-systemd debug release release-check release-check-strict asan valgrind check test test-advisory unit-test integration-test info all: $(TARGET) @@ -94,7 +94,9 @@ check: @command -v clang-tidy >/dev/null 2>&1 && clang-tidy src/*.c -- -Iinclude $(INCLUDES) || echo "clang-tidy not installed" # Test -test: all unit-test +test: all unit-test integration-test + +test-advisory: all unit-test @echo "Running integration tests..." @cd tests && PORT=$${PORT:-2222} ./test_basic.sh || echo "(basic integration tests are advisory)" @cd tests && PORT=$$(($${PORT:-2222} + 1)) ./test_exec_mode.sh || echo "(exec mode tests are advisory)" @@ -104,6 +106,12 @@ unit-test: @echo "Running unit tests..." @$(MAKE) -C tests/unit run +integration-test: all + @echo "Running integration tests..." + @cd tests && PORT=$${PORT:-2222} ./test_basic.sh + @cd tests && PORT=$$(($${PORT:-2222} + 1)) ./test_exec_mode.sh + @cd tests && PORT=$$(($${PORT:-2222} + 2)) ./test_interactive_input.sh + # Show build info info: @echo "Compiler: $(CC)" diff --git a/README.md b/README.md index eec5d92..866a7d8 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,8 @@ make clean # clean build artifacts ### Testing ```sh -make test # run comprehensive test suite +make test # run comprehensive test suite and fail on regressions +make test-advisory # run integration tests as advisory checks # Individual tests cd tests diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index de6a012..bd7eaed 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -41,6 +41,10 @@ - Idle-timeout disconnect notices now follow the session UI language. ### Changed +- `make test` now fails on integration-test regressions; constrained local + environments can use `make test-advisory` for the previous advisory behavior. +- Removed the duplicate `deploy.yml` CI workflow so automated checks stay + focused on CI while production deployment remains manual. - NORMAL mode now opens at the latest visible messages instead of the oldest in-memory message. Use `k`/PageUp to browse older history and `G`/End to return to the latest messages. diff --git a/docs/CICD.md b/docs/CICD.md index 0ab9dbd..a43110c 100644 --- a/docs/CICD.md +++ b/docs/CICD.md @@ -6,7 +6,7 @@ AUTOMATIC TESTING Every push or PR automatically runs: - Build on Ubuntu - AddressSanitizer build - - Unit and integration tests + - Unit and strict integration tests - Release/package preflight (`make release-check`) Check status: diff --git a/docs/Development-Guide.md b/docs/Development-Guide.md index 7b3977f..75d8ac1 100644 --- a/docs/Development-Guide.md +++ b/docs/Development-Guide.md @@ -159,7 +159,8 @@ make install # Install to /usr/local/bin ### Running Tests ```sh -make test # Run all tests +make test # Run all tests and fail on regressions +make test-advisory # Run integration tests as advisory checks # Individual tests cd tests