diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 198c68fba..4d98797d4 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -56,7 +56,7 @@ jobs: python-version: ${{ matrix.cfg.python-version }} toxenv: ${{ matrix.cfg.toxenv }} runner: ${{ matrix.os }} - hps-version: ${{ inputs.hps-version || 'v1.2.0' }} + hps-version: ${{ inputs.hps-version || 'latest-dev' }} hps-feature: ${{ inputs.hps-feature || 'main' }} docs: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index abea292f0..c7493f8ec 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -46,7 +46,7 @@ jobs: python-version: ${{ matrix.cfg.python-version }} toxenv: ${{ matrix.cfg.toxenv }} runner: ${{ matrix.os }} - hps-version: ${{ inputs.hps-version || 'v1.2.0' }} + hps-version: ${{ inputs.hps-version || 'latest-dev' }} smoke-tests: name: Build and Smoke tests diff --git a/tests/auth/test_api.py b/tests/auth/test_api.py index 55bf8efa9..3f09e3bb3 100644 --- a/tests/auth/test_api.py +++ b/tests/auth/test_api.py @@ -132,10 +132,10 @@ def test_impersonate_user(url, keycloak_client): r = None try: r = authenticate( - url=url, + auth_url=client.auth_url, client_id=rep_impersonation_client["clientId"], client_secret=rep_impersonation_client["secret"], - scope="opendid offline_access", + scope="openid offline_access", grant_type="urn:ietf:params:oauth:grant-type:token-exchange", subject_token=client.access_token, requested_token_type="urn:ietf:params:oauth:token-type:refresh_token", @@ -143,6 +143,7 @@ def test_impersonate_user(url, keycloak_client): verify=False, ) except HPSError as e: + log.error(e) if e.response.status_code == 501 and "Feature not enabled" in e.reason: pytest.skip("This test requires to enable the feature 'token-exchange' in keycloak.") diff --git a/tests/auth/test_authenticate.py b/tests/auth/test_authenticate.py index 4342cbabf..727fc297e 100644 --- a/tests/auth/test_authenticate.py +++ b/tests/auth/test_authenticate.py @@ -25,19 +25,25 @@ import pytest import requests -from ansys.hps.client import authenticate +from ansys.hps.client import Client, authenticate log = logging.getLogger(__name__) def test_authenticate(url, username, password): - resp = authenticate(url=url, username=username, password=password, verify=False) + client = Client(url=url, username=username, password=password, verify=False) + resp = authenticate( + auth_url=client.auth_url, username=username, password=password, verify=False + ) assert "access_token" in resp assert "refresh_token" in resp def test_authenticate_with_ssl_verification(url, username, password): + # Doesn't matter that the auth url is wrong.... The first request will fail with pytest.raises(requests.exceptions.SSLError) as ex_info: - _ = authenticate(url=url, username=username, password=password, verify=True) + _ = authenticate( + auth_url=f"{url}/auth/realms/rep", username=username, password=password, verify=True + ) assert "CERTIFICATE_VERIFY_FAILED" in str(ex_info.value)