Skip to content

Commit e8c2dab

Browse files
Add LIBSIGNAL_TESTING_IGNORE_KT_TESTS to skip key transparency tests while we await service recovery
1 parent b6db49f commit e8c2dab

File tree

6 files changed

+53
-7
lines changed

6 files changed

+53
-7
lines changed

.github/workflows/slow_tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ on:
2323
# This is redundant with specifying it at the use site, but makes it appear in the website UI.
2424
# See https://github.com/actions/runner-images/blob/main/README.md#available-images
2525
default: 'macos-15-xlarge'
26+
ignore_kt_tests:
27+
type: boolean
28+
description: 'Skip Key Transparency tests (sets LIBSIGNAL_TESTING_IGNORE_KT_TESTS)'
29+
default: true
2630

2731
jobs:
2832
java-docker:
@@ -35,6 +39,12 @@ jobs:
3539
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3640
with:
3741
submodules: recursive
42+
- name: Enable KT skip flag
43+
if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && inputs.ignore_kt_tests == true) }}
44+
run: echo "LIBSIGNAL_TESTING_IGNORE_KT_TESTS=true" >> "$GITHUB_ENV"
45+
- name: Print KT env toggle
46+
run: |
47+
echo "LIBSIGNAL_TESTING_IGNORE_KT_TESTS=${LIBSIGNAL_TESTING_IGNORE_KT_TESTS:-<unset>}"
3848
- run: make -C java
3949
- name: Upload JNI libraries
4050
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
@@ -65,6 +75,9 @@ jobs:
6575
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6676
with:
6777
submodules: recursive
78+
- name: Enable KT skip flag
79+
if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && inputs.ignore_kt_tests == true) }}
80+
run: echo "LIBSIGNAL_TESTING_IGNORE_KT_TESTS=true" >> "$GITHUB_ENV"
6881
- run: make -C java
6982
- name: Upload full JARs
7083
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
@@ -118,6 +131,9 @@ jobs:
118131
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
119132
with:
120133
submodules: recursive
134+
- name: Enable KT skip flag
135+
if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && inputs.ignore_kt_tests == true) }}
136+
run: echo "LIBSIGNAL_TESTING_IGNORE_KT_TESTS=true" >> "$GITHUB_ENV"
121137

122138
- run: sudo apt-get install protobuf-compiler
123139

@@ -213,6 +229,9 @@ jobs:
213229
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
214230
with:
215231
submodules: recursive
232+
- name: Enable KT skip flag
233+
if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && inputs.ignore_kt_tests == true) }}
234+
run: echo "LIBSIGNAL_TESTING_IGNORE_KT_TESTS=true" >> "$GITHUB_ENV"
216235

217236
- run: sudo apt-get update && sudo apt-get install protobuf-compiler
218237

@@ -237,6 +256,9 @@ jobs:
237256
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
238257
with:
239258
submodules: recursive
259+
- name: Enable KT skip flag
260+
if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && inputs.ignore_kt_tests == true) }}
261+
run: echo "LIBSIGNAL_TESTING_IGNORE_KT_TESTS=true" >> "$GITHUB_ENV"
240262
- run: node/docker-prebuildify.sh
241263
- run: npm ci && npm run tsc && npm run test
242264
working-directory: node
@@ -331,6 +353,9 @@ jobs:
331353
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
332354
with:
333355
submodules: recursive
356+
- name: Enable KT skip flag
357+
if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && inputs.ignore_kt_tests == true) }}
358+
run: echo "LIBSIGNAL_TESTING_IGNORE_KT_TESTS=true" >> "$GITHUB_ENV"
334359

335360
- run: rustup toolchain install $(cat rust-toolchain) --profile minimal --target x86_64-apple-ios,aarch64-apple-ios,aarch64-apple-ios-sim --component rust-src
336361

@@ -379,6 +404,9 @@ jobs:
379404
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
380405
with:
381406
submodules: recursive
407+
- name: Enable KT skip flag
408+
if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && inputs.ignore_kt_tests == true) }}
409+
run: echo "LIBSIGNAL_TESTING_IGNORE_KT_TESTS=true" >> "$GITHUB_ENV"
382410

383411
- run: sudo apt-get update && sudo apt-get install gcc-multilib g++-multilib protobuf-compiler
384412

java/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ java_build: DOCKER_EXTRA=$(shell [ -L build ] && P=$$(readlink build) && echo -v
2121
java_build: docker_image
2222
$(DOCKER) run $(DOCKER_TTY_FLAG) --init --rm --user $$(id -u):$$(id -g) \
2323
--env LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS \
24+
--env LIBSIGNAL_TESTING_IGNORE_KT_TESTS \
2425
--env LIBSIGNAL_TESTING_PROXY_SERVER \
2526
-v `cd .. && pwd`/:/home/libsignal/src $(DOCKER_EXTRA) $(DOCKER_IMAGE) \
2627
sh -c "cd src/java; ./gradlew $(GRADLE_OPTIONS) build $(CROSS_COMPILE_SERVER)"

java/client/src/test/java/org/signal/libsignal/net/KeyTransparencyClientTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ class KeyTransparencyClientTest {
188188

189189
companion object {
190190
private const val USER_AGENT = "test"
191-
private val INTEGRATION_TESTS_ENABLED = TestEnvironment.get("LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS") != null
191+
private val INTEGRATION_TESTS_ENABLED =
192+
TestEnvironment.get("LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS") != null &&
193+
TestEnvironment.get("LIBSIGNAL_TESTING_IGNORE_KT_TESTS") == null
192194
}
193195
}

node/ts/test/KeyTransparencyTest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ describe('KeyTransparency Integration', function (this: Mocha.Suite) {
159159
this.timeout(5000);
160160

161161
before(() => {
162-
if (!process.env.LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS) {
162+
const ignoreKtTests =
163+
typeof process.env.LIBSIGNAL_TESTING_IGNORE_KT_TESTS !== 'undefined';
164+
if (!process.env.LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS || ignoreKtTests) {
163165
this.ctx.skip();
164166
}
165167
});

rust/net/chat/src/ws/keytrans.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,13 +494,19 @@ mod test {
494494
};
495495
use super::*;
496496

497+
fn kt_integration_enabled() -> bool {
498+
let run_nonhermetic = std::env::var_os("LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS").is_some();
499+
let ignore_tests = std::env::var_os("LIBSIGNAL_TESTING_IGNORE_KT_TESTS").is_some();
500+
run_nonhermetic && !ignore_tests
501+
}
502+
497503
#[tokio::test]
498504
#[test_case(false, false; "ACI")]
499505
#[test_case(true, false; "ACI + E164")]
500506
#[test_case(false, true; "ACI + Username Hash")]
501507
#[test_case(true, true; "ACI + E164 + Username Hash")]
502508
async fn search_permutations_integration_test(use_e164: bool, use_username_hash: bool) {
503-
if std::env::var("LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS").is_err() {
509+
if !kt_integration_enabled() {
504510
println!("SKIPPED: running integration tests is not enabled");
505511
return;
506512
}
@@ -540,7 +546,7 @@ mod test {
540546
#[test_case(false; "unknown_distinguished")]
541547
#[test_case(true; "known_distinguished")]
542548
async fn distinguished_integration_test(have_last_distinguished: bool) {
543-
if std::env::var("LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS").is_err() {
549+
if !kt_integration_enabled() {
544550
println!("SKIPPED: running integration tests is not enabled");
545551
return;
546552
}
@@ -567,7 +573,7 @@ mod test {
567573
#[test_case(false, true; "ACI + Username Hash")]
568574
#[test_case(true, true; "ACI + E164 + Username Hash")]
569575
async fn monitor_permutations_integration_test(use_e164: bool, use_username_hash: bool) {
570-
if std::env::var("LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS").is_err() {
576+
if !kt_integration_enabled() {
571577
println!("SKIPPED: running integration tests is not enabled");
572578
return;
573579
}
@@ -621,7 +627,7 @@ mod test {
621627

622628
#[tokio::test]
623629
async fn search_for_deleted_account() {
624-
if std::env::var("LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS").is_err() {
630+
if !kt_integration_enabled() {
625631
println!("SKIPPED: running integration tests is not enabled");
626632
return;
627633
}
@@ -653,7 +659,7 @@ mod test {
653659

654660
#[tokio::test]
655661
async fn search_for_account_that_isnt() {
656-
if std::env::var("LIBSIGNAL_TESTING_RUN_NONHERMETIC_TESTS").is_err() {
662+
if !kt_integration_enabled() {
657663
println!("SKIPPED: running integration tests is not enabled");
658664
return;
659665
}

swift/Tests/LibSignalClientTests/KeyTransparencyTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ extension TestAccount {
5757
final class KeyTransparencyTests: TestCaseBase {
5858
private let userAgent = "kt-test"
5959

60+
override func nonHermeticTest() throws {
61+
if ProcessInfo.processInfo.environment["LIBSIGNAL_TESTING_IGNORE_KT_TESTS"] != nil {
62+
throw XCTSkip("disabled via LIBSIGNAL_TESTING_IGNORE_KT_TESTS")
63+
}
64+
try super.nonHermeticTest()
65+
}
66+
6067
private var testAccount = TestAccount(
6168
aci: Aci(fromUUID: UUID(uuidString: "90c979fd-eab4-4a08-b6da-69dedeab9b29")!),
6269
identityKey: try! IdentityKey(

0 commit comments

Comments
 (0)