Skip to content

Validate the deployment (optional)

After the post-install setup, your instance is ready to use, and most people can stop there.

This page is for the times when you need to prove the deployment is really working well. The geo-deploy is a test suite that tests all GEO Knowledge Hub API endpoints, covering Knowledge Packages, Knowledge Resources, drafts and file uploads, communities, search and DOI.

You need a running instance to use the geo-deploy, so finish the quickstart first. You also need to have applied the post-install setup, so everything required (i.e., vocabularies, roles) are ready and available.

On your own machine, the only requirement is Python 3.12+ and uv.

To start, first clone the repository:

Terminal window
git clone https://github.com/geo-knowledge-hub/geo-deploy.git

Then, move to it:

Terminal window
cd geo-deploy

Now, on the directory, let’s install the geo-deploy and its dependencies using uv:

Terminal window
uv sync

Most of the tests write to the API, so they need to authenticate as a valid user. To let the geo-deploy authenticate, you need to provide valid access token for the tool.

For this, open your instance in a browser, click your avatar in the top right corner and go to Settings. Then, on the left sidebar, click on Applications. Under Personal access tokens, click New token, give it a name such as geo-deploy, and select all the available scopes. When you click Create, the token is shown once and never again, so copy it before leaving the page.

The suite reads its settings from a .env file in the project folder. To create one, we can start from the example file provided in the repository:

Terminal window
cp .env.example .env

Then open .env and fill in your values:

Terminal window
GEO_BASE_URL=https://invenio.local:8080
GEO_API_TOKEN=<your token>
GEO_NO_VERIFY_TLS=true

The GEO_BASE_URL is the root URL of your instance, written without a trailing slash. The GEO_API_TOKEN is the token you created in the previous step. It is also possible to define the GEO_NO_VERIFY_TLS, which enable or disable the verification of HTTPS certificate.

To run everything:

Terminal window
uv run pytest tests/ -v

The tests are split in two groups, and you can run them separately. The UI tests check that the public pages answer, and they work without a token:

Terminal window
uv run pytest tests/ui/ -v

The API tests exercise the endpoints and do require a valid token:

Terminal window
uv run pytest tests/api/ -v

When you are chasing one specific problem, running the whole suite is slower than it needs to be. Each feature has its own test, so you can run just the one you care about:

FeatureCommand
Knowledge Packagesuv run pytest tests/api/test_packages.py -v
Knowledge Resourcesuv run pytest tests/api/test_resources.py -v
Drafts and filesuv run pytest tests/api/test_drafts.py -v
Communitiesuv run pytest tests/api/test_communities.py -v
Search, including spatialuv run pytest tests/api/test_search.py -v
DOIuv run pytest tests/api/test_doi.py -v
Public UIuv run pytest tests/ui/ -v

1) Try the REST API examples against your instance.

2) Review the parameters reference to fine-tune resource limits, autoscaling, and bundled-services credentials.