OCL API 2
Build: #2047 failed
Job: Run tests failed
Job result summary
- Completed
- Duration
- 8 minutes
- Agent
- xiao.openmrs.org
- Revision
-
bacaff61fb58716e85346c110b3d244897cc7dfd
bacaff61fb58716e85346c110b3d244897cc7dfd - Failing since
- #2045 (Code changes detected – )
- Fixed in
- #2049 (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_public_can_find_globally_without_compose ... ok
test_public_can_view ... ok
test_unable_to_represent_as_fhir ... Traceback (most recent call last):
File "/code/core/value_sets/serializers.py", line 253, 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')]
Failed to represent "/invalid/uri" as ValueSet
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-280', 'lastName': 'Last-280', 'email': 'email280@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-280', 'lastName': 'Last-280', 'email': 'email280@test.com', 'username': 'username', 'credentials': [{'type': 'password', 'hashedSaltedValue': 'tTDQLsdu8LOByFHNVMx6DLNpEbgsLdcF7Pwuw6fS2YE=', 'algorithm': 'pbkdf2-sha256', 'hashIterations': 600000, 'salt': 'RllEWE5NQjEwVmJ5eDhDZGpVdHhaNg==', '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 843 tests in 395.892s
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
test_public_can_view ... ok
test_unable_to_represent_as_fhir ... Traceback (most recent call last):
File "/code/core/value_sets/serializers.py", line 253, 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')]
Failed to represent "/invalid/uri" as ValueSet
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-280', 'lastName': 'Last-280', 'email': 'email280@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-280', 'lastName': 'Last-280', 'email': 'email280@test.com', 'username': 'username', 'credentials': [{'type': 'password', 'hashedSaltedValue': 'tTDQLsdu8LOByFHNVMx6DLNpEbgsLdcF7Pwuw6fS2YE=', 'algorithm': 'pbkdf2-sha256', 'hashIterations': 600000, 'salt': 'RllEWE5NQjEwVmJ5eDhDZGpVdHhaNg==', '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 843 tests in 395.892s
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