Skip to content

Commit 1321108

Browse files
committed
Add a pre-connectivity test for e2e tests
1 parent e060a65 commit 1321108

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/workflows/tests-e2e.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
NEPTUNE_QUERY_RETRY_SOFT_TIMEOUT: "120"
5858
TEST_MARKERS: ${{ matrix.test_markers }}
5959
run: |
60+
curl -I "$(base64 -d <<< $NEPTUNE_E2E_API_TOKEN | jq .api_url -r )"/api/leaderboard/ &&
6061
pytest --capture=no tests/e2e/test_connectivity.py &&
6162
pytest --retries=1 --retry-delay=2 --junitxml="test-results/test-e2e.xml" ${TEST_MARKERS:+-m "$TEST_MARKERS"} tests/e2e
6263
# --capture=no is passed to the test_connectivity run, so that we can see logs from data ingestion

tests/e2e/test_connectivity.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import base64
2+
import json
3+
import os
4+
5+
import httpx
16
import pytest
27

38
from tests.e2e.conftest import EnsureProjectFunction
@@ -26,3 +31,12 @@ def project_1(ensure_project: EnsureProjectFunction) -> IngestedProjectData:
2631
def test_connectivity(client, project_1: IngestedProjectData) -> None:
2732
"""A placeholder test to ensure connectivity to the Neptune server"""
2833
assert True
34+
35+
36+
if __name__ == "__main__":
37+
# Run this with python -m tests.e2e.test_connectivity
38+
api_token = os.getenv("NEPTUNE_E2E_API_TOKEN")
39+
url = json.loads(base64.b64decode(api_token).decode())["api_url"] + "/api/leaderboard/"
40+
code = httpx.get(url).status_code
41+
print(f"{code} {url}")
42+
assert code == 403

0 commit comments

Comments
 (0)