Skip to content

Run the badssl.com tests in CI without failing the build - #39

Merged
garethsb merged 1 commit into
cpprest-ltsfrom
ci/badssl-optional
Nov 5, 2026
Merged

garethsb merged 1 commit into
cpprest-ltsfrom
ci/badssl-optional

Conversation

@garethsb

@garethsb garethsb commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

The tests that connect to badssl.com fail in most CI runs with TLS handshake errors or timeouts, and a different set fails each time, because the badssl.com servers are unreliable. That keeps every pull request red, and makes it impossible to require status checks.

This PR keeps running those tests, but it no longer lets them fail the job:

  • The tests: the 17 tests that use badssl.com are tagged "Requires", "badssl". The test runner skips a test with that tag unless it gets /badssl. There are 12 in outside_tests.cpp, the two HTTPS-to-HTTP redirect tests in redirect_tests.cpp, and 3 websocket client tests in authentication_tests.cpp.
  • CMake: registers httpclient_test_badssl and websocketsclient_test_badssl, labelled badssl. They run test_runner /badssl /select:@Requires=badssl, so they run only the tagged tests.
  • CI: the Ubuntu, macOS and Windows jobs run the other tests with ctest -LE badssl, and then run the badssl.com tests with ctest -L badssl in a separate step with continue-on-error. The step still shows in each job's log when it fails.

Running plain ctest locally still runs everything, including the badssl.com tests.

#38 tracks replacing badssl.com with local TLS servers, so that these tests can go back into the main test step.

Testing

I tested a Release build with Clang 21 on Ubuntu 26.04, with WebSockets enabled. ctest -LE badssl runs the 8 normal tests, and none of the badssl.com tests are in their listing. ctest -L badssl runs the 2 new tests, which run exactly the 17 tagged tests. Both pass.

#37 adds a Clang job that runs plain ctest. Whichever of the two pull requests merges second needs to give that job the same two test steps.

Part of #38.

Co-authored-by: Gareth's 🤖 buddy

The tests that connect to badssl.com fail in most CI runs with TLS
handshake errors or timeouts, and different tests fail each time,
because the badssl.com servers are unreliable. Tag those tests with
"Requires", "badssl", so the test runner skips them unless it is given
/badssl, and register httpclient_test_badssl and
websocketsclient_test_badssl, labelled badssl, to run only them.

In CI, run the other tests with -LE badssl, then run the badssl.com
tests in a separate step that does not fail the job.

Signed-off-by: Gareth Sylvester-Bradley <garethsb@nvidia.com>
@garethsb
garethsb merged commit 8670f7c into cpprest-lts Nov 5, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant