Skip to content

Commit 8172332

Browse files
Consolidate token helper script (#240)
* Consolidate token helpers into scripts/set-test-tokens.sh * Standardize the script name on hyphen-separated shell-script naming
1 parent b825ab5 commit 8172332

9 files changed

Lines changed: 12 additions & 200 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- client-sdk-rust
5757
- client-sdk-rust/**
5858
- cmake/**
59-
- .token_helpers/**
59+
- scripts/set-test-tokens.sh
6060
- scripts/run-with-backtrace.sh
6161
- CMakeLists.txt
6262
- CMakePresets.json

‎.github/workflows/tests.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ jobs:
407407
LIVEKIT_CREATE_TOKEN_URL: ${{ steps.token_server.outputs.token-url }}
408408
run: |
409409
set -euo pipefail
410-
source .token_helpers/set_data_track_test_tokens.bash
410+
source scripts/set-test-tokens.sh
411411
# TODO(BOT-477) Temporarily disable platform audio integration tests in CI until instability is resolved
412412
bash scripts/run-with-backtrace.sh \
413413
${{ env.BUILD_DIR }}/bin/livekit_integration_tests \
@@ -424,7 +424,7 @@ jobs:
424424
RUST_LOG: "metrics=debug"
425425
run: |
426426
set -euo pipefail
427-
source .token_helpers/set_data_track_test_tokens.bash
427+
source scripts/set-test-tokens.sh
428428
bash scripts/run-with-backtrace.sh \
429429
${{ env.BUILD_DIR }}/bin/livekit_stress_tests \
430430
--gtest_repeat=${{ inputs.stress_repeat }} \
@@ -621,4 +621,3 @@ jobs:
621621
name: coverage-report
622622
path: coverage-html/
623623
retention-days: 14
624-

‎.token_helpers/README.md‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎.token_helpers/gen_and_set.bash‎

Lines changed: 0 additions & 169 deletions
This file was deleted.

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,15 @@ CI step will fail loudly if its symbols escape the public ABI of
346346
Tests are under `src/tests/` using Google Test:
347347

348348
```bash
349-
source .token_helpers/set_data_track_test_tokens.bash
349+
source scripts/set-test-tokens.sh
350350
./build.sh debug-tests
351351
cd build-debug && ctest
352352
```
353353

354354
Always source the test tokens before running tests, even for a targeted local
355355
test run. The integration and stress suites require `LIVEKIT_URL`,
356356
`LIVEKIT_TOKEN_A`, and `LIVEKIT_TOKEN_B`; use
357-
`source .token_helpers/set_data_track_test_tokens.bash` from the repository
357+
`source scripts/set-test-tokens.sh` from the repository
358358
root so the current shell inherits them. Do not report an integration test as
359359
verified just because it was skipped for missing tokens. If tokens cannot be
360360
sourced or the LiveKit server is not available, say that the integration test

‎docs/authentication.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ export LIVEKIT_TOKEN=$(lk token create \
4545
```
4646

4747
For integration tests that need two participants, see
48-
[testing.md](testing.md#generating-tokens-for-the-test-suites) and the helper
49-
script under `.token_helpers/`.
48+
[testing.md](testing.md#generating-tokens-for-the-test-suites) and
49+
[`scripts/set-test-tokens.sh`](../scripts/set-test-tokens.sh).
5050

5151
## Direct connect (URL + token)
5252

‎docs/testing.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ participant tokens against a local `livekit-server --dev` and exports
8181
`LIVEKIT_TOKEN_A`, `LIVEKIT_TOKEN_B`, and `LIVEKIT_URL` for the current shell:
8282

8383
```bash
84-
source .token_helpers/set_data_track_test_tokens.bash
84+
source scripts/set-test-tokens.sh
8585
```
8686

8787
To generate tokens manually (e.g. against a non-default server), install

.token_helpers/set_data_track_test_tokens.bash renamed to scripts/set-test-tokens.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# required by the C++ SDK's integration and stress tests (data tracks, RPC,
1818
# media multistream, etc.).
1919
#
20-
# source .token_helpers/set_data_track_test_tokens.bash
21-
# eval "$(bash .token_helpers/set_data_track_test_tokens.bash)"
20+
# source scripts/set-test-tokens.sh
21+
# eval "$(bash scripts/set-test-tokens.sh)"
2222
#
2323
# Exports:
2424
# LIVEKIT_TOKEN_A
@@ -34,7 +34,7 @@ elif [[ -n "${ZSH_VERSION:-}" ]] && [[ "${ZSH_EVAL_CONTEXT:-}" == *:file* ]]; th
3434
fi
3535

3636
_fail() {
37-
echo "set_data_track_test_tokens.bash: $1" >&2
37+
echo "set_test_tokens: $1" >&2
3838
if [[ "$_sourced" -eq 1 ]]; then
3939
return "${2:-1}"
4040
fi
@@ -123,5 +123,5 @@ if [[ "$_sourced" -eq 1 ]]; then
123123
echo "LIVEKIT_TOKEN_A, LIVEKIT_TOKEN_B, and LIVEKIT_URL set for this shell." >&2
124124
else
125125
_emit_eval
126-
echo "set_data_track_test_tokens.bash: for this shell run: source $0 or: eval \"\$(bash $0 ...)\"" >&2
126+
echo "set_test_tokens: for this shell run: source $0 or: eval \"\$(bash $0)\"" >&2
127127
fi

‎src/tests/integration/test_data_track.cpp‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
// This test is used to verify that data tracks are published and received
18-
// correctly. It is the same implementation as the rust
19-
// client-sdk-rust/livekit/tests/data_track_test.rs test. To run this test, run
20-
// a local SFU, set credentials examples/tokens/set_data_track_test_tokens.bash,
21-
// and run:
22-
// ./build-debug/bin/livekit_integration_tests
23-
2417
#include <livekit/data_track_options.h>
2518
#include <livekit/data_track_schema.h>
2619
#include <livekit/data_track_stream.h>

0 commit comments

Comments
 (0)