Skip to content

Commit

Permalink
CI: restore running integration tests in CI
Browse files Browse the repository at this point in the history
When we cut over to the Rust based integration tests we neglected to
update the `make test` call-sites to also run `make integration`. The
`test` PHONY target doesn't run the `--ignored` cargo tests that include
the integration component.

For the Windows makefile (not CMake) we must also update a test
invocation to specify that cert verification should be skipped,
otherwise the test just generates usage help.

For the CMake windows targets, a few changes are needed:

1. We need to run the integration tests separately from the
   `TEST_COMMAND` - the test binaries are built by this process, and so
   we can't rely on them to exist for the integration test to use until
   afterwards
2. We need to run only the client/server tests. The CMake builds
   disagree with the non-CMake builds about the required linker parts
   for the `verify_static_libs` integration test.
  • Loading branch information
cpu committed Dec 3, 2023
1 parent 0501b98 commit e212c01
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- env:
CARGO_UNSTABLE_HTTP_REGISTRY: true
run: make CC=${{ matrix.cc }} PROFILE=release test
- run: make CC=${{ matrix.cc }} PROFILE=release test integration

valgrind:
name: Valgrind
Expand All @@ -54,6 +55,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y valgrind
- run: export VALGRIND="valgrind -q"
- run: make test
- run: make integration

test-windows:
name: Windows
Expand All @@ -67,7 +69,8 @@ jobs:
# Remove link.exe from non-MSVC packages that interferes with MSVC link
- run: rm "C:\Program Files\Git\usr\bin\link.exe"
- run: rm "C:\msys64\usr\bin\link.exe"
- run: make -f Makefile.Windows
- run: make -f Makefile.Windows test
- run: make -f Makefile.Windows integration

test-windows-cmake-debug:
name: Windows CMake, Debug configuration
Expand All @@ -82,9 +85,11 @@ jobs:
run: cmake -S . -B build
- name: Build, debug configuration
run: cmake --build build --config Debug
- name: Integration test, debug configuration
run: cargo test --locked --test client_server client_server_integration -- --ignored --exact
env:
CLIENT_BINARY: build/tests/Debug/client.exe
SERVER_BINARY: build/tests/Debug/server.exe
CLIENT_BINARY: D:\a\rustls-ffi\rustls-ffi\build\tests\Debug\client.exe
SERVER_BINARY: D:\a\rustls-ffi\rustls-ffi\build\tests\Debug\server.exe

test-windows-cmake-release:
name: Windows CMake, Release configuration
Expand All @@ -99,9 +104,11 @@ jobs:
run: cmake -S . -B build
- name: Build, release configuration
run: cmake --build build --config Release
- name: Integration test, release configuration
run: cargo test --locked --test client_server client_server_integration -- --ignored --exact
env:
CLIENT_BINARY: build/tests/Release/client.exe
SERVER_BINARY: build/tests/Release/server.exe
CLIENT_BINARY: D:\a\rustls-ffi\rustls-ffi\build\tests\Release\client.exe
SERVER_BINARY: D:\a\rustls-ffi\rustls-ffi\build\tests\Release\server.exe

ensure-header-updated:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Windows
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ all: $(RUSTLS_LIB) target/client.exe target/server.exe

test: all
$(call green_msg, getting 'https://httpbin.org/headers' ...)
target/client.exe httpbin.org 443 /headers
NO_CHECK_CERTIFICATE=1 target/client.exe httpbin.org 443 /headers
$(call green_msg, Running 'cargo test')
cargo test --locked

Expand Down

0 comments on commit e212c01

Please sign in to comment.