Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,28 @@ export TEST_CLIENT_SECRET_FILENAME=
export TEST_CLIENT_SECRET="ey.....................ab=="
task functests
```
Lastly when running the runner tests one can specify a namespace to isolate instances of assets in differnt
When running the runner tests one can specify a namespace to isolate instances of assets in differnt
runs:
```bash
export ARCHIVIST_NAMESPACE=${RANDOM}
FUNCTEST=execrunner task functests
```

Additional environment variables:

For testing sharing via an access policy requires a second auth token:

```bash
TEST_AUTHTOKEN_FILENAME_2=
```

Testing of the client token refresh logic can take 10 to 20 minutes to complete.
To enable this test set:

```bash
TEST_REFRESH_TOKEN=anything
```

#### Testing Other Python Versions

##### Python 3.7 (default)
Expand Down
6 changes: 5 additions & 1 deletion functests/execaccess_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from copy import deepcopy
from os import getenv
from unittest import TestCase
from unittest import TestCase, skipIf
from uuid import uuid4

from archivist.archivist import Archivist
Expand Down Expand Up @@ -115,6 +115,10 @@ def test_access_policies_count(self):
)


@skipIf(
getenv("TEST_AUTHTOKEN_FILENAME_2") is None,
"cannot run test as TEST_AUTHTOKEN_FILENAME_2 is not set",
)
class TestAccessPolicies(TestAccessPoliciesBase):
"""
Test Archivist AccessPolicies Create method
Expand Down
10 changes: 9 additions & 1 deletion functests/execapplications.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from json import dumps as json_dumps
from os import getenv
from time import sleep
from unittest import TestCase
from unittest import TestCase, skipIf
from uuid import uuid4

from archivist.archivist import Archivist
Expand Down Expand Up @@ -136,6 +136,10 @@ def test_applications_list(self):
"""
Test application list
"""
application = self.arch.applications.create(
self.display_name,
CUSTOM_CLAIMS,
)
applications = list(self.arch.applications.list(display_name=self.display_name))
self.assertGreater(
len(applications),
Expand Down Expand Up @@ -193,6 +197,10 @@ def test_appidp_token_404(self):
client_secret,
)

@skipIf(
getenv("TEST_REFRESH_TOKEN") is None,
"cannot run test as TEST_REFRESH_TOKEN is not set",
)
def test_archivist_token(self):
"""
Test archivist with client id/secret
Expand Down
1 change: 1 addition & 0 deletions scripts/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ docker run \
-e TEST_CLIENT_SECRET \
-e TEST_CLIENT_SECRET_FILENAME \
-e TEST_DEBUG \
-e TEST_REFRESH_TOKEN \
jitsuin-archivist-python-builder \
"$@"