You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use absolute path to find credential files in unit tests (#340)
Fixes#339
### Motivation
Currently the relative path is used in unit tests to specify the token
file (`.test-token.txt`) and the credential directory (`./test-conf`).
If we don't run the `pulsar-tests` binary in a subdirectory, it won't
be able to read these files.
### Modifications
Add the macro `-DTOKEN_PATH="..." -DTEST_CONF_DIR="..."` to specify
absolute paths according to the `PROJECT_SOURCE_DIR`, which is defined
by CMake as the absolute path of the project directory.
### Verifications
```bash
cmake -B build
cmake --build build -j8
# Run the test in project directory
./build/tests/pulsar-tests --gtest_filter='AuthPlugin*:*testRSAEncryption:*testEncryptionFailure:*DecryptionFailedMessages'
# Run the test in a subdirectory
cd build
./tests/pulsar-tests --gtest_filter='AuthPlugin*:*testRSAEncryption:*testEncryptionFailure:*DecryptionFailedMessages'
```
0 commit comments