Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commented out bulk aggregation tests for now #351

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions tests/test_access/tst_access_drogon_affiliate_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,28 +204,29 @@ def test_read_restricted_classification_data(explorer: Explorer):
print("Hits on restricted:", hits)
assert hits >= 1

@pytest.mark.skipif(not (sys.platform == "linux" and
sys.version_info[:2] == (3, 11)),
reason="Test only on single platform/version.")
def test_aggregate_bulk(explorer: Explorer):
"""Test a bulk aggregation method"""
print("Running test:", inspect.currentframe().f_code.co_name)
# Fixed test case ("Drogon_AHM_2023-02-22") in Sumo/DEV
# This user does not have WRITE and hence this should fail
# (In addition this case is not set up with affiliate access)
TESTCASE_UUID = "10f41041-2c17-4374-a735-bb0de62e29dc"
print("About to trigger bulk aggregation on case", TESTCASE_UUID)
body = {
"operations": ["min"],
"case_uuid": TESTCASE_UUID,
"class": "surface",
"iteration_name": "iter-0",
}
with pytest.raises(Exception, match="40*"):
response = explorer._sumo.post(f"/aggregations", json=body)
print("Execution should never reach this line")
print("Unexpected status: ", response.status_code)
print("Unexpected response: ", response.text)
# Remove or update this test when bulk aggregation is finalized
# @pytest.mark.skipif(not (sys.platform == "linux" and
# sys.version_info[:2] == (3, 11)),
# reason="Test only on single platform/version.")
# def test_aggregate_bulk(explorer: Explorer):
# """Test a bulk aggregation method"""
# print("Running test:", inspect.currentframe().f_code.co_name)
# # Fixed test case ("Drogon_AHM_2023-02-22") in Sumo/DEV
# # This user does not have WRITE and hence this should fail
# # (In addition this case is not set up with affiliate access)
# TESTCASE_UUID = "10f41041-2c17-4374-a735-bb0de62e29dc"
# print("About to trigger bulk aggregation on case", TESTCASE_UUID)
# body = {
# "operations": ["min"],
# "case_uuid": TESTCASE_UUID,
# "class": "surface",
# "iteration_name": "iter-0",
# }
# with pytest.raises(Exception, match="40*"):
# response = explorer._sumo.post(f"/aggregations", json=body)
# print("Execution should never reach this line")
# print("Unexpected status: ", response.status_code)
# print("Unexpected response: ", response.text)


def test_aggregations_fast(explorer: Explorer):
Expand Down
54 changes: 27 additions & 27 deletions tests/test_access/tst_access_drogon_manage_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,33 @@ def test_read_restricted_classification_data(explorer: Explorer):
print("Hits on restricted:", hits)
assert hits > 0


@pytest.mark.skipif(not (sys.platform == "linux" and
sys.version_info[:2] == (3, 11)),
reason="Test only on single platform/version.")
def test_aggregations_bulk(explorer: Explorer):
"""Test a bulk aggregation method"""
print("Running test:", inspect.currentframe().f_code.co_name)
cases = explorer.cases.filter(status="scratch")
print("Number of cases: ", len(cases))
assert len(cases) > 0
case = None
for c in cases:
if len(c.realizations) > 1 and len(c.surfaces) > 40:
case = c
break
assert case
case_uuid = case.metadata.get("fmu").get("case").get("uuid")
print("About to trigger aggregation on case", case_uuid)
body = {
"operations": ["min"],
"case_uuid": case_uuid,
"class": "surface",
"iteration_name": case.iterations[0].name,
}
response = explorer._sumo.post(f"/aggregations", json=body)
print(response.status_code)
assert response.status_code in [200, 201, 202]
# Remove or update this test when bulk aggregation is finalized
# @pytest.mark.skipif(not (sys.platform == "linux" and
# sys.version_info[:2] == (3, 11)),
# reason="Test only on single platform/version.")
# def test_aggregations_bulk(explorer: Explorer):
# """Test a bulk aggregation method"""
# print("Running test:", inspect.currentframe().f_code.co_name)
# cases = explorer.cases.filter(status="scratch")
# print("Number of cases: ", len(cases))
# assert len(cases) > 0
# case = None
# for c in cases:
# if len(c.realizations) > 1 and len(c.surfaces) > 40:
# case = c
# break
# assert case
# case_uuid = case.metadata.get("fmu").get("case").get("uuid")
# print("About to trigger aggregation on case", case_uuid)
# body = {
# "operations": ["min"],
# "case_uuid": case_uuid,
# "class": "surface",
# "iteration_name": case.iterations[0].name,
# }
# response = explorer._sumo.post(f"/aggregations", json=body)
# print(response.status_code)
# assert response.status_code in [200, 201, 202]


def test_aggregations_fast(explorer: Explorer):
Expand Down
62 changes: 31 additions & 31 deletions tests/test_access/tst_access_drogon_read_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,37 +150,37 @@ def test_aggregations_fast(explorer: Explorer):
assert response.status_code in [200, 201, 202]
print("Length of returned aggregate object:", len(response.text))


@pytest.mark.skipif(not (sys.platform == "linux" and
sys.version_info[:2] == (3, 11)),
reason="Test only on single platform/version.")
def test_aggregate_bulk(explorer: Explorer):
"""Test a bulk aggregation method"""
print("Running test:", inspect.currentframe().f_code.co_name)
cases = explorer.cases
print("Number of cases: ", len(cases))
assert len(cases) > 0
case = None
for c in cases:
if len(c.realizations) > 1 and len(c.surfaces) > 40:
case = c
break
assert case
case_uuid = case.metadata.get("fmu").get("case").get("uuid")
body = {
"operations": ["min"],
"case_uuid": case_uuid,
"class": "surface",
"iteration_name": case.iterations[0].name,
}
print("About to trigger bulk aggregation on case", case_uuid)
print("using body", body, " this should raise exception")
# A READ role user CANNOT trigger BULK aggregation
with pytest.raises(Exception, match="403*"):
response = explorer._sumo.post(f"/aggregations", json=body)
print("Execution should never reach this line")
print("Unexpected status: ", response.status_code)
print("Unexpected response: ", response.text)
# Remove or update this test when bulk aggregation is finalized
# @pytest.mark.skipif(not (sys.platform == "linux" and
# sys.version_info[:2] == (3, 11)),
# reason="Test only on single platform/version.")
# def test_aggregate_bulk(explorer: Explorer):
# """Test a bulk aggregation method"""
# print("Running test:", inspect.currentframe().f_code.co_name)
# cases = explorer.cases
# print("Number of cases: ", len(cases))
# assert len(cases) > 0
# case = None
# for c in cases:
# if len(c.realizations) > 1 and len(c.surfaces) > 40:
# case = c
# break
# assert case
# case_uuid = case.metadata.get("fmu").get("case").get("uuid")
# body = {
# "operations": ["min"],
# "case_uuid": case_uuid,
# "class": "surface",
# "iteration_name": case.iterations[0].name,
# }
# print("About to trigger bulk aggregation on case", case_uuid)
# print("using body", body, " this should raise exception")
# # A READ role user CANNOT trigger BULK aggregation
# with pytest.raises(Exception, match="403*"):
# response = explorer._sumo.post(f"/aggregations", json=body)
# print("Execution should never reach this line")
# print("Unexpected status: ", response.status_code)
# print("Unexpected response: ", response.text)


def test_get_access_log(explorer: Explorer):
Expand Down
54 changes: 27 additions & 27 deletions tests/test_access/tst_access_drogon_write_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,33 @@ def test_read_restricted_classification_data(explorer: Explorer):
print("Hits on restricted:", hits)
assert hits > 0


@pytest.mark.skipif(not (sys.platform == "linux" and
sys.version_info[:2] == (3, 11)),
reason="Test only on single platform/version.")
def test_aggregate_bulk(explorer: Explorer):
"""Test a bulk aggregation method"""
print("Running test:", inspect.currentframe().f_code.co_name)
cases = explorer.cases.filter(status="scratch")
print("Number of cases: ", len(cases))
assert len(cases) > 0
case = None
for c in cases:
if len(c.realizations) > 1 and len(c.surfaces) > 40:
case = c
break
assert case
case_uuid = case.metadata.get("fmu").get("case").get("uuid")
print("About to trigger aggregation on case", case_uuid)
body = {
"operations": ["min"],
"case_uuid": case_uuid,
"class": "surface",
"iteration_name": case.iterations[0].name,
}
response = explorer._sumo.post(f"/aggregations", json=body)
print(response.status_code)
assert response.status_code in [200, 201, 202]
# Remove or update this test when bulk aggregation is finalized
# @pytest.mark.skipif(not (sys.platform == "linux" and
# sys.version_info[:2] == (3, 11)),
# reason="Test only on single platform/version.")
# def test_aggregate_bulk(explorer: Explorer):
# """Test a bulk aggregation method"""
# print("Running test:", inspect.currentframe().f_code.co_name)
# cases = explorer.cases.filter(status="scratch")
# print("Number of cases: ", len(cases))
# assert len(cases) > 0
# case = None
# for c in cases:
# if len(c.realizations) > 1 and len(c.surfaces) > 40:
# case = c
# break
# assert case
# case_uuid = case.metadata.get("fmu").get("case").get("uuid")
# print("About to trigger aggregation on case", case_uuid)
# body = {
# "operations": ["min"],
# "case_uuid": case_uuid,
# "class": "surface",
# "iteration_name": case.iterations[0].name,
# }
# response = explorer._sumo.post(f"/aggregations", json=body)
# print(response.status_code)
# assert response.status_code in [200, 201, 202]


def test_aggregations_fast(explorer: Explorer):
Expand Down
42 changes: 21 additions & 21 deletions tests/test_access/tst_access_no_access_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,27 +157,27 @@ def test_get_message_log_truncate(explorer: Explorer):
print("Unexpected status: ", response.status_code)
print("Unexpected response: ", response.text)


@pytest.mark.skipif(not (sys.platform == "linux" and
sys.version_info[:2] == (3, 11)),
reason="Test only on single platform/version.")
def test_aggregate_bulk(explorer: Explorer):
"""Test a bulk aggregation method"""
print("Running test:", inspect.currentframe().f_code.co_name)
# Fixed test case ("Drogon_AHM_2023-02-22") in Sumo/DEV
TESTCASE_UUID = "10f41041-2c17-4374-a735-bb0de62e29dc"
print("About to trigger bulk aggregation on case", TESTCASE_UUID)
body = {
"operations": ["min"],
"case_uuid": TESTCASE_UUID,
"class": "surface",
"iteration_name": "iter-0",
}
with pytest.raises(Exception, match="40*"):
response = explorer._sumo.post(f"/aggregations", json=body)
print("Execution should never reach this line")
print("Unexpected status: ", response.status_code)
print("Unexpected response: ", response.text)
# Remove or update this test when bulk aggregation is finalized
# @pytest.mark.skipif(not (sys.platform == "linux" and
# sys.version_info[:2] == (3, 11)),
# reason="Test only on single platform/version.")
# def test_aggregate_bulk(explorer: Explorer):
# """Test a bulk aggregation method"""
# print("Running test:", inspect.currentframe().f_code.co_name)
# # Fixed test case ("Drogon_AHM_2023-02-22") in Sumo/DEV
# TESTCASE_UUID = "10f41041-2c17-4374-a735-bb0de62e29dc"
# print("About to trigger bulk aggregation on case", TESTCASE_UUID)
# body = {
# "operations": ["min"],
# "case_uuid": TESTCASE_UUID,
# "class": "surface",
# "iteration_name": "iter-0",
# }
# with pytest.raises(Exception, match="40*"):
# response = explorer._sumo.post(f"/aggregations", json=body)
# print("Execution should never reach this line")
# print("Unexpected status: ", response.status_code)
# print("Unexpected response: ", response.text)


def test_aggregations_fast(explorer: Explorer):
Expand Down