ci: make integration tests strict

This commit is contained in:
m1ngsama 2026-05-23 21:26:19 +08:00
parent 6ec86eb016
commit 6d5c77b850
6 changed files with 19 additions and 35 deletions

View file

@ -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

View file

@ -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)"

View file

@ -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

View file

@ -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.

View file

@ -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:

View file

@ -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