mirror of
https://oauth2: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@github.com/m1ngsama/TNT.git
synced 2026-06-26 06:54:38 +08:00
ci: make integration tests strict
This commit is contained in:
parent
6ec86eb016
commit
6d5c77b850
6 changed files with 19 additions and 35 deletions
30
.github/workflows/deploy.yml
vendored
30
.github/workflows/deploy.yml
vendored
|
|
@ -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
|
|
||||||
12
Makefile
12
Makefile
|
|
@ -30,7 +30,7 @@ BINDIR ?= $(PREFIX)/bin
|
||||||
MANDIR ?= $(PREFIX)/share/man
|
MANDIR ?= $(PREFIX)/share/man
|
||||||
SYSTEMD_UNIT_DIR ?= $(PREFIX)/lib/systemd/system
|
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)
|
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"
|
@command -v clang-tidy >/dev/null 2>&1 && clang-tidy src/*.c -- -Iinclude $(INCLUDES) || echo "clang-tidy not installed"
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
test: all unit-test
|
test: all unit-test integration-test
|
||||||
|
|
||||||
|
test-advisory: all unit-test
|
||||||
@echo "Running integration tests..."
|
@echo "Running integration tests..."
|
||||||
@cd tests && PORT=$${PORT:-2222} ./test_basic.sh || echo "(basic integration tests are advisory)"
|
@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)"
|
@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..."
|
@echo "Running unit tests..."
|
||||||
@$(MAKE) -C tests/unit run
|
@$(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
|
# Show build info
|
||||||
info:
|
info:
|
||||||
@echo "Compiler: $(CC)"
|
@echo "Compiler: $(CC)"
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,8 @@ make clean # clean build artifacts
|
||||||
### Testing
|
### Testing
|
||||||
|
|
||||||
```sh
|
```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
|
# Individual tests
|
||||||
cd tests
|
cd tests
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,10 @@
|
||||||
- Idle-timeout disconnect notices now follow the session UI language.
|
- Idle-timeout disconnect notices now follow the session UI language.
|
||||||
|
|
||||||
### Changed
|
### 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
|
- 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
|
in-memory message. Use `k`/PageUp to browse older history and `G`/End to
|
||||||
return to the latest messages.
|
return to the latest messages.
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ AUTOMATIC TESTING
|
||||||
Every push or PR automatically runs:
|
Every push or PR automatically runs:
|
||||||
- Build on Ubuntu
|
- Build on Ubuntu
|
||||||
- AddressSanitizer build
|
- AddressSanitizer build
|
||||||
- Unit and integration tests
|
- Unit and strict integration tests
|
||||||
- Release/package preflight (`make release-check`)
|
- Release/package preflight (`make release-check`)
|
||||||
|
|
||||||
Check status:
|
Check status:
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,8 @@ make install # Install to /usr/local/bin
|
||||||
### Running Tests
|
### Running Tests
|
||||||
|
|
||||||
```sh
|
```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
|
# Individual tests
|
||||||
cd tests
|
cd tests
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue