OCL API 2
Build: #2124 failed
Job: Run tests failed
Job result summary
- Completed
- Duration
- 20 minutes
- Agent
- xindi.openmrs.org
- Revision
-
e67a640c5e5b90d7b7f517f697b0ea977d50f60f
e67a640c5e5b90d7b7f517f697b0ea977d50f60f - Fixed in
- #2125 (Manual run from the stage: Release by Sunny Aggarwal.)
Error summary
The build generated some errors. See the full build log for more details.
test_expand ... ok
test_public_can_find_globally ... ok
test_public_can_find_globally_without_compose ... ok
test_public_can_view ... ok
test_unable_to_represent_as_fhir ... Failed to represent "/invalid/uri" as ValueSet
Traceback (most recent call last):
File "/code/core/value_sets/serializers.py", line 254, in to_representation
IdentifierSerializer.include_ocl_identifier(instance.uri, RESOURCE_TYPE, rep)
File "/code/core/common/serializers.py", line 141, in include_ocl_identifier
return IdentifierSerializer.parse_identifier(ident)
File "/code/core/common/serializers.py", line 88, in parse_identifier
raise ValidationError(
rest_framework.exceptions.ValidationError: [ErrorDetail(string='Identifier must be in a format: /{owner_type}/{owner_id}/{resourceType}/{resource_id}/, given: /invalid/uri', code='invalid')]
ok
test_update_with_compose ... ok
test_validate_code ... ok
test_validate_code_globally ... ok
test_validate_code_globally_negative ... ok
test_validate_code_globally_via_post ... ok
test_validate_code_negative ... ok
core.tasks.tests.UtilsTest
test_wait_until_task_complete_finished ... ok
test_wait_until_task_complete_pending ... ok
======================================================================
FAIL: test_add_user (core.services.auth.tests.OpenIDAuthServiceTest)
----------------------------------------------------------------------
[38;5;26mTraceback (most recent call last):[39m
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m1370[39m, in patched
[38;5;250m [39m[38;5;28;01mreturn[39;00m func([38;5;241m*[39mnewargs, [38;5;241m*[39m[38;5;241m*[39mnewkeywargs)
File [38;5;28m"/code/core/services/auth/tests.py"[39m, line [38;5;241m90[39m, in test_add_user
[38;5;250m [39mpost_mock[38;5;241m.[39massert_called_once_with(
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m931[39m, in assert_called_once_with
[38;5;250m [39m[38;5;28;01mreturn[39;00m [38;5;28mself[39m[38;5;241m.[39massert_called_with([38;5;241m*[39margs, [38;5;241m*[39m[38;5;241m*[39mkwargs)
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m919[39m, in assert_called_with
[38;5;250m [39m[38;5;28;01mraise[39;00m [38;5;167;01mAssertionError[39;00m(_error_message()) [38;5;28;01mfrom[39;00m [38;5;21;01mcause[39;00m
[38;5;160mAssertionError[39m: expected call not found.
Expected: post('/admin/realms/ocl/users', json={'enabled': True, 'emailVerified': True, 'firstName': 'First-320', 'lastName': 'Last-320', 'email': 'email320@test.com', 'username': 'username', 'credentials': <ANY>}, verify=False, headers={'Authorization': 'Bearer token'})
Actual: post('http://host.docker.internal:8080/admin/realms/ocl/users', json={'enabled': True, 'emailVerified': True, 'firstName': 'First-320', 'lastName': 'Last-320', 'email': 'email320@test.com', 'username': 'username', 'credentials': [{'type': 'password', 'hashedSaltedValue': 'zE0CtZHRPLNVffbpVX4GjY6AGAHM/XcvZFUwANtf2cU=', 'algorithm': 'pbkdf2-sha256', 'hashIterations': 600000, 'salt': 'eU9wdlVXSElJdGJsejk2aW1MdWcwag==', 'temporary': False}]}, verify=False, headers={'Authorization': 'Bearer token'})
======================================================================
FAIL: test_exchange_code_for_token (core.services.auth.tests.OpenIDAuthServiceTest)
----------------------------------------------------------------------
[38;5;26mTraceback (most recent call last):[39m
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m1370[39m, in patched
[38;5;250m [39m[38;5;28;01mreturn[39;00m func([38;5;241m*[39mnewargs, [38;5;241m*[39m[38;5;241m*[39mnewkeywargs)
File [38;5;28m"/code/core/services/auth/tests.py"[39m, line [38;5;241m48[39m, in test_exchange_code_for_token
[38;5;250m [39mpost_mock[38;5;241m.[39massert_called_once_with(
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m931[39m, in assert_called_once_with
[38;5;250m [39m[38;5;28;01mreturn[39;00m [38;5;28mself[39m[38;5;241m.[39massert_called_with([38;5;241m*[39margs, [38;5;241m*[39m[38;5;241m*[39mkwargs)
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m919[39m, in assert_called_with
[38;5;250m [39m[38;5;28;01mraise[39;00m [38;5;167;01mAssertionError[39;00m(_error_message()) [38;5;28;01mfrom[39;00m [38;5;21;01mcause[39;00m
[38;5;160mAssertionError[39m: expected call not found.
Expected: post('/realms/ocl/protocol/openid-connect/token', data={'grant_type': 'authorization_code', 'client_id': 'client-id', 'client_secret': 'client-secret', 'code': 'code', 'redirect_uri': 'http://localhost:4000'})
Actual: post('http://host.docker.internal:8080/realms/ocl/protocol/openid-connect/token', data={'grant_type': 'authorization_code', 'client_id': 'client-id', 'client_secret': 'client-secret', 'code': 'code', 'redirect_uri': 'http://localhost:4000'})
======================================================================
FAIL: test_get_admin_token (core.services.auth.tests.OpenIDAuthServiceTest)
----------------------------------------------------------------------
[38;5;26mTraceback (most recent call last):[39m
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m1370[39m, in patched
[38;5;250m [39m[38;5;28;01mreturn[39;00m func([38;5;241m*[39mnewargs, [38;5;241m*[39m[38;5;241m*[39mnewkeywargs)
File [38;5;28m"/code/core/services/auth/tests.py"[39m, line [38;5;241m66[39m, in test_get_admin_token
[38;5;250m [39mpost_mock[38;5;241m.[39massert_called_once_with(
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m931[39m, in assert_called_once_with
[38;5;250m [39m[38;5;28;01mreturn[39;00m [38;5;28mself[39m[38;5;241m.[39massert_called_with([38;5;241m*[39margs, [38;5;241m*[39m[38;5;241m*[39mkwargs)
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m919[39m, in assert_called_with
[38;5;250m [39m[38;5;28;01mraise[39;00m [38;5;167;01mAssertionError[39;00m(_error_message()) [38;5;28;01mfrom[39;00m [38;5;21;01mcause[39;00m
[38;5;160mAssertionError[39m: expected call not found.
Expected: post('/realms/master/protocol/openid-connect/token', data={'grant_type': 'password', 'username': 'username', 'password': 'password', 'client_id': 'admin-cli'}, verify=False)
Actual: post('http://host.docker.internal:8080/realms/master/protocol/openid-connect/token', data={'grant_type': 'password', 'username': 'username', 'password': 'password', 'client_id': 'admin-cli'}, verify=False)
======================================================================
FAIL: test_get_login_redirect_url (core.services.auth.tests.OpenIDAuthServiceTest)
----------------------------------------------------------------------
[38;5;26mTraceback (most recent call last):[39m
File [38;5;28m"/code/core/services/auth/tests.py"[39m, line [38;5;241m26[39m, in test_get_login_redirect_url
[38;5;250m [39m[38;5;28mself[39m[38;5;241m.[39massertEqual(
[38;5;160mAssertionError[39m: 'http://localhost:8080/realms/ocl/protocol[123 chars]4000' != '/realms/ocl/protocol/openid-connect/auth?[102 chars]4000'
- http://localhost:8080/realms/ocl/protocol/openid-connect/auth?response_type=code id_token&client_id=client-id&state=state&nonce=nonce&redirect_uri=http://localhost:4000
? ---------------------
+ /realms/ocl/protocol/openid-connect/auth?response_type=code id_token&client_id=client-id&state=state&nonce=nonce&redirect_uri=http://localhost:4000
======================================================================
FAIL: test_get_logout_redirect_url (core.services.auth.tests.OpenIDAuthServiceTest)
----------------------------------------------------------------------
[38;5;26mTraceback (most recent call last):[39m
File [38;5;28m"/code/core/services/auth/tests.py"[39m, line [38;5;241m33[39m, in test_get_logout_redirect_url
[38;5;250m [39m[38;5;28mself[39m[38;5;241m.[39massertEqual(
[38;5;160mAssertionError[39m: 'http://localhost:8080/realms/ocl/protocol[93 chars]4000' != '/realms/ocl/protocol/openid-connect/logou[72 chars]4000'
- http://localhost:8080/realms/ocl/protocol/openid-connect/logout?id_token_hint=id-token-hint&post_logout_redirect_uri=http://localhost:4000
? ---------------------
+ /realms/ocl/protocol/openid-connect/logout?id_token_hint=id-token-hint&post_logout_redirect_uri=http://localhost:4000
----------------------------------------------------------------------
Ran 887 tests in 1127.695s
FAILED (failures=5)
Preserving test database for alias 'default' ('test_postgres')...
1
Stopping ocl-oclapi2-rt_db_1 ...
Stopping ocl-oclapi2-rt_es_1 ...
Stopping ocl-oclapi2-rt_db_1 ... done
Stopping ocl-oclapi2-rt_es_1 ... done
Removing ocl-oclapi2-rt_db_1 ...
Removing ocl-oclapi2-rt_es_1 ...
Removing ocl-oclapi2-rt_es_1 ... done
Removing ocl-oclapi2-rt_db_1 ... done
Removing network ocl-oclapi2-rt_default
Removing volume ocl-oclapi2-rt_postgres-data
Removing volume ocl-oclapi2-rt_es-data
Removing volume ocl-oclapi2-rt_redis-data
Removing volume ocl-oclapi2-rt_upload-data
test_public_can_find_globally ... ok
test_public_can_find_globally_without_compose ... ok
test_public_can_view ... ok
test_unable_to_represent_as_fhir ... Failed to represent "/invalid/uri" as ValueSet
Traceback (most recent call last):
File "/code/core/value_sets/serializers.py", line 254, in to_representation
IdentifierSerializer.include_ocl_identifier(instance.uri, RESOURCE_TYPE, rep)
File "/code/core/common/serializers.py", line 141, in include_ocl_identifier
return IdentifierSerializer.parse_identifier(ident)
File "/code/core/common/serializers.py", line 88, in parse_identifier
raise ValidationError(
rest_framework.exceptions.ValidationError: [ErrorDetail(string='Identifier must be in a format: /{owner_type}/{owner_id}/{resourceType}/{resource_id}/, given: /invalid/uri', code='invalid')]
ok
test_update_with_compose ... ok
test_validate_code ... ok
test_validate_code_globally ... ok
test_validate_code_globally_negative ... ok
test_validate_code_globally_via_post ... ok
test_validate_code_negative ... ok
core.tasks.tests.UtilsTest
test_wait_until_task_complete_finished ... ok
test_wait_until_task_complete_pending ... ok
======================================================================
FAIL: test_add_user (core.services.auth.tests.OpenIDAuthServiceTest)
----------------------------------------------------------------------
[38;5;26mTraceback (most recent call last):[39m
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m1370[39m, in patched
[38;5;250m [39m[38;5;28;01mreturn[39;00m func([38;5;241m*[39mnewargs, [38;5;241m*[39m[38;5;241m*[39mnewkeywargs)
File [38;5;28m"/code/core/services/auth/tests.py"[39m, line [38;5;241m90[39m, in test_add_user
[38;5;250m [39mpost_mock[38;5;241m.[39massert_called_once_with(
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m931[39m, in assert_called_once_with
[38;5;250m [39m[38;5;28;01mreturn[39;00m [38;5;28mself[39m[38;5;241m.[39massert_called_with([38;5;241m*[39margs, [38;5;241m*[39m[38;5;241m*[39mkwargs)
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m919[39m, in assert_called_with
[38;5;250m [39m[38;5;28;01mraise[39;00m [38;5;167;01mAssertionError[39;00m(_error_message()) [38;5;28;01mfrom[39;00m [38;5;21;01mcause[39;00m
[38;5;160mAssertionError[39m: expected call not found.
Expected: post('/admin/realms/ocl/users', json={'enabled': True, 'emailVerified': True, 'firstName': 'First-320', 'lastName': 'Last-320', 'email': 'email320@test.com', 'username': 'username', 'credentials': <ANY>}, verify=False, headers={'Authorization': 'Bearer token'})
Actual: post('http://host.docker.internal:8080/admin/realms/ocl/users', json={'enabled': True, 'emailVerified': True, 'firstName': 'First-320', 'lastName': 'Last-320', 'email': 'email320@test.com', 'username': 'username', 'credentials': [{'type': 'password', 'hashedSaltedValue': 'zE0CtZHRPLNVffbpVX4GjY6AGAHM/XcvZFUwANtf2cU=', 'algorithm': 'pbkdf2-sha256', 'hashIterations': 600000, 'salt': 'eU9wdlVXSElJdGJsejk2aW1MdWcwag==', 'temporary': False}]}, verify=False, headers={'Authorization': 'Bearer token'})
======================================================================
FAIL: test_exchange_code_for_token (core.services.auth.tests.OpenIDAuthServiceTest)
----------------------------------------------------------------------
[38;5;26mTraceback (most recent call last):[39m
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m1370[39m, in patched
[38;5;250m [39m[38;5;28;01mreturn[39;00m func([38;5;241m*[39mnewargs, [38;5;241m*[39m[38;5;241m*[39mnewkeywargs)
File [38;5;28m"/code/core/services/auth/tests.py"[39m, line [38;5;241m48[39m, in test_exchange_code_for_token
[38;5;250m [39mpost_mock[38;5;241m.[39massert_called_once_with(
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m931[39m, in assert_called_once_with
[38;5;250m [39m[38;5;28;01mreturn[39;00m [38;5;28mself[39m[38;5;241m.[39massert_called_with([38;5;241m*[39margs, [38;5;241m*[39m[38;5;241m*[39mkwargs)
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m919[39m, in assert_called_with
[38;5;250m [39m[38;5;28;01mraise[39;00m [38;5;167;01mAssertionError[39;00m(_error_message()) [38;5;28;01mfrom[39;00m [38;5;21;01mcause[39;00m
[38;5;160mAssertionError[39m: expected call not found.
Expected: post('/realms/ocl/protocol/openid-connect/token', data={'grant_type': 'authorization_code', 'client_id': 'client-id', 'client_secret': 'client-secret', 'code': 'code', 'redirect_uri': 'http://localhost:4000'})
Actual: post('http://host.docker.internal:8080/realms/ocl/protocol/openid-connect/token', data={'grant_type': 'authorization_code', 'client_id': 'client-id', 'client_secret': 'client-secret', 'code': 'code', 'redirect_uri': 'http://localhost:4000'})
======================================================================
FAIL: test_get_admin_token (core.services.auth.tests.OpenIDAuthServiceTest)
----------------------------------------------------------------------
[38;5;26mTraceback (most recent call last):[39m
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m1370[39m, in patched
[38;5;250m [39m[38;5;28;01mreturn[39;00m func([38;5;241m*[39mnewargs, [38;5;241m*[39m[38;5;241m*[39mnewkeywargs)
File [38;5;28m"/code/core/services/auth/tests.py"[39m, line [38;5;241m66[39m, in test_get_admin_token
[38;5;250m [39mpost_mock[38;5;241m.[39massert_called_once_with(
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m931[39m, in assert_called_once_with
[38;5;250m [39m[38;5;28;01mreturn[39;00m [38;5;28mself[39m[38;5;241m.[39massert_called_with([38;5;241m*[39margs, [38;5;241m*[39m[38;5;241m*[39mkwargs)
File [38;5;28m"/usr/local/lib/python3.10/unittest/mock.py"[39m, line [38;5;241m919[39m, in assert_called_with
[38;5;250m [39m[38;5;28;01mraise[39;00m [38;5;167;01mAssertionError[39;00m(_error_message()) [38;5;28;01mfrom[39;00m [38;5;21;01mcause[39;00m
[38;5;160mAssertionError[39m: expected call not found.
Expected: post('/realms/master/protocol/openid-connect/token', data={'grant_type': 'password', 'username': 'username', 'password': 'password', 'client_id': 'admin-cli'}, verify=False)
Actual: post('http://host.docker.internal:8080/realms/master/protocol/openid-connect/token', data={'grant_type': 'password', 'username': 'username', 'password': 'password', 'client_id': 'admin-cli'}, verify=False)
======================================================================
FAIL: test_get_login_redirect_url (core.services.auth.tests.OpenIDAuthServiceTest)
----------------------------------------------------------------------
[38;5;26mTraceback (most recent call last):[39m
File [38;5;28m"/code/core/services/auth/tests.py"[39m, line [38;5;241m26[39m, in test_get_login_redirect_url
[38;5;250m [39m[38;5;28mself[39m[38;5;241m.[39massertEqual(
[38;5;160mAssertionError[39m: 'http://localhost:8080/realms/ocl/protocol[123 chars]4000' != '/realms/ocl/protocol/openid-connect/auth?[102 chars]4000'
- http://localhost:8080/realms/ocl/protocol/openid-connect/auth?response_type=code id_token&client_id=client-id&state=state&nonce=nonce&redirect_uri=http://localhost:4000
? ---------------------
+ /realms/ocl/protocol/openid-connect/auth?response_type=code id_token&client_id=client-id&state=state&nonce=nonce&redirect_uri=http://localhost:4000
======================================================================
FAIL: test_get_logout_redirect_url (core.services.auth.tests.OpenIDAuthServiceTest)
----------------------------------------------------------------------
[38;5;26mTraceback (most recent call last):[39m
File [38;5;28m"/code/core/services/auth/tests.py"[39m, line [38;5;241m33[39m, in test_get_logout_redirect_url
[38;5;250m [39m[38;5;28mself[39m[38;5;241m.[39massertEqual(
[38;5;160mAssertionError[39m: 'http://localhost:8080/realms/ocl/protocol[93 chars]4000' != '/realms/ocl/protocol/openid-connect/logou[72 chars]4000'
- http://localhost:8080/realms/ocl/protocol/openid-connect/logout?id_token_hint=id-token-hint&post_logout_redirect_uri=http://localhost:4000
? ---------------------
+ /realms/ocl/protocol/openid-connect/logout?id_token_hint=id-token-hint&post_logout_redirect_uri=http://localhost:4000
----------------------------------------------------------------------
Ran 887 tests in 1127.695s
FAILED (failures=5)
Preserving test database for alias 'default' ('test_postgres')...
1
Stopping ocl-oclapi2-rt_db_1 ...
Stopping ocl-oclapi2-rt_es_1 ...
Stopping ocl-oclapi2-rt_db_1 ... done
Stopping ocl-oclapi2-rt_es_1 ... done
Removing ocl-oclapi2-rt_db_1 ...
Removing ocl-oclapi2-rt_es_1 ...
Removing ocl-oclapi2-rt_es_1 ... done
Removing ocl-oclapi2-rt_db_1 ... done
Removing network ocl-oclapi2-rt_default
Removing volume ocl-oclapi2-rt_postgres-data
Removing volume ocl-oclapi2-rt_es-data
Removing volume ocl-oclapi2-rt_redis-data
Removing volume ocl-oclapi2-rt_upload-data