Skip to content

Commit a2c0bb1

Browse files
authored
Update auth tests (#397)
* Update auth tests * Chrysalis tests pass * Explain error causes and add tests * Make test more usable * Fix test_ls_globus * Chrysalis fixes * Perlmutter fixes * Compy fixes
1 parent ce18814 commit a2c0bb1

File tree

5 files changed

+441
-167
lines changed

5 files changed

+441
-167
lines changed

tests/README.md

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ tests/
1515
utils/ # Utilities for testing
1616
```
1717

18-
## Testing example for Perlmutter
18+
## Testing examples
19+
20+
### Machine Independent
1921

2022
```bash
2123
rm -rf build
@@ -29,9 +31,19 @@ pytest tests/unit/test_*.py
2931
python -m unittest tests/integration/python_tests/group_by_command/test_*.py
3032
# Ran 69 tests in 327.570s
3133
# OK
34+
# NOTE: Some tests will be skipped on systems without hsi/HPSS access
3235
python -m unittest tests/integration/python_tests/group_by_workflow/test_*.py
3336
# Ran 4 tests in 2.666s
3437
# OK
38+
39+
cd tests/integration/bash_tests/run_from_any/
40+
# Review the directions at the bottom of globus_auth.bash
41+
# Run `./globus_auth.bash` with the appropriate parameters.
42+
```
43+
44+
### Perlmutter-specific
45+
46+
```bash
3547
cd tests/integration/bash_tests/run_from_perlmutter/
3648
time ./follow_symlinks.sh # NOTE: you will have to change out paths for your username
3749
# real 0m31.851s
@@ -42,52 +54,29 @@ time ./test_update_non_empty_hpss.bash
4254

4355
# Log into globus.org
4456
# Log into endpoints (NERSC Perlmutter, Globus Tutorial Collection 1) at globus.org: File Manager > Add the endpoints in the "Collection" fields
45-
time ./test_ls_globus.bash
46-
# real 0m26.930s
57+
time ./test_ls_globus.bash # NOTE: You may be asked to paste an auth-code
58+
# real 0m40.297s
4759
# No errors
4860
```
4961

50-
## Testing example for Chrysalis
62+
### Chrysalis-specific
5163

5264
```bash
53-
rm -rf build
54-
conda clean --all --y
55-
conda env create -f conda/dev.yml -n zstash_dev_20251017_test1
56-
conda activate zstash_dev_20251017_test1
57-
pre-commit run --all-files
58-
python -m pip install .
59-
pytest tests/unit/test_*.py
60-
# 1 passed in 0.84s
61-
python -m unittest tests/integration/python_tests/group_by_command/test_*.py
62-
# Ran 69 tests in 110.139s
63-
# OK (skipped=32)
64-
# NOTE: Some tests are skipped because Chrysalis doesn't have direct `hsi`/HPSS access
65-
python -m unittest tests/integration/python_tests/group_by_workflow/test_*.py
66-
# Ran 4 tests in 6.889s
67-
# OK
6865
cd tests/integration/bash_tests/run_from_chrysalis/
69-
70-
# Log into globus.org
71-
# 1. Log into endpoints (LCRC Improv DTN, NERSC Perlmutter) at globus.org: File Manager > Add the endpoints in the "Collection" fields
72-
# 2. To start fresh, with no consents: https://auth.globus.org/v2/web/consents > Manage Your Consents > Globus Endpoint Performance Monitoring > rescind all"
73-
# Then, increment `try_num` below to avoid using an old directory.
74-
# Alternatively, start fresh by deleting the directory on Perlmutter:
75-
# `rm -rf /global/homes/f/forsyth/zstash/tests/test_globus_auth_try{try_num}`
76-
time ./globus_auth.bash try_num # NOTE: you will have to change out paths for your username
77-
# Paste the URL into your browser
78-
# Log into Argonne
79-
# Log into NERSC
80-
# Provide a label
81-
# Copy the auth code to the command line
82-
#
83-
# real 2m45.954s
84-
# No errors
85-
8666
# If not done above, do the following:
8767
# Log into globus.org
8868
# Log into endpoints (LCRC Improv DTN, NERSC Perlmutter) at globus.org: File Manager > Add the endpoints in the "Collection" fields
8969

90-
# In all cases, do:
70+
# Reset completely:
71+
# Revoke consents: https://auth.globus.org/v2/web/consents > Globus Endpoint Performance Monitoring > rescind all
72+
# Run the following lines to set up the database_corruption test
73+
# Alternative option: Rerun the `test_single_auth_code ${path_to_repo} NERSC_PERLMUTTER_ENDPOINT ${perlmutter_dst_dir}` line from `globus_auth.bash`
74+
rm ~/.zstash_globus_tokens.json
75+
mkdir zstash_demo; echo 'file0 stuff' > zstash_demo/file0.txt
76+
# NERSC_PERLMUTTER_ENDPOINT=6bdc7956-fc0f-4ad2-989c-7aa5ee643a79
77+
zstash create --hpss=globus://6bdc7956-fc0f-4ad2-989c-7aa5ee643a79//global/homes/f/forsyth/zstash/tests/test_database_corruption_setup23 zstash_demo
78+
# You'll have to paste an auth code here, but NOT during the database_corruption test.
79+
rm -rf zstash_demo/
9180
# Then, increment `try_num` below to avoid using an old directory.
9281
# Alternatively, start fresh by deleting the directory on Perlmutter:
9382
# `rm -rf /global/homes/f/forsyth/zstash/tests/test_database_corruption_try{try_num}`

0 commit comments

Comments
 (0)