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

Make tests robust and independent #543

Merged
merged 28 commits into from
Sep 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2102c83
Use request.node.name for make_dantzig scenarios
glatterf42 Mar 12, 2024
c625e12
Fix typo in docstring
glatterf42 Mar 12, 2024
31d7a44
Group tutorials that depend on each other
glatterf42 Mar 12, 2024
d68f757
Give every platform a test-specific name
glatterf42 Mar 12, 2024
6a8bd54
Use test-specific name for scenarios
glatterf42 Mar 12, 2024
c7d94ef
Use test-specific name for platforms
glatterf42 Mar 12, 2024
38ac174
Revert temporary fix from #510
glatterf42 Mar 12, 2024
b955aab
Copy model["dantzig"] properly
glatterf42 Mar 12, 2024
3b62932
Avoid searching for to-be-created test-specific platforms
glatterf42 Mar 18, 2024
540d613
Search for correct new scenario name
glatterf42 Mar 18, 2024
4127f57
Increase default cell runtime on GHA
glatterf42 Mar 18, 2024
6c111d8
Use more test-specific platforms
glatterf42 Mar 18, 2024
9f6afa3
Make call to to-be-tested function explicit
glatterf42 Mar 18, 2024
4a67769
Rename expected data files for individual tests
glatterf42 Mar 18, 2024
f3615ce
Call Scenario deletion function explicitly
glatterf42 Mar 22, 2024
6216c02
Call TimeSeries deletion function explicitly
glatterf42 Mar 22, 2024
12bfcc3
Add type hint for correct specific backend type
glatterf42 Mar 22, 2024
12464ed
Remove timeseries from jindex explicitly
glatterf42 Mar 22, 2024
d469fd3
Discard tmp_path directories after each test
glatterf42 Sep 11, 2024
bb48e78
Drop workaround for jupyter/nbclient#85
glatterf42 Sep 11, 2024
918298f
Make second R tutorial independent with helper function
glatterf42 Sep 11, 2024
34f0595
Mark first tutorial tests as flaky on Windows
glatterf42 Sep 12, 2024
6a50d32
Mark test_del_ts as flaky on Windows
glatterf42 Sep 12, 2024
5b30a63
Remove xfail marker for consistently xpassing test
glatterf42 Sep 12, 2024
fc76fab
Distinguish platforms for more stability
glatterf42 Sep 12, 2024
61b40cb
Expand typing in .testing.data
khaeru Sep 12, 2024
97f1121
Remove editor-specific notebook metadata
glatterf42 Sep 12, 2024
749709e
Address review comments
glatterf42 Sep 12, 2024
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
Prev Previous commit
Next Next commit
Rename expected data files for individual tests
glatterf42 committed Sep 11, 2024
commit 4a6776961d9a361b0923f544d47139c788d32a6c
File renamed without changes.
16 changes: 16 additions & 0 deletions ixmp/tests/data/test_check_single_model_access.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Used by test_access.py

config.name = unit_test_db@local

jdbc.driver = org.hsqldb.jdbcDriver
jdbc.url = jdbc:hsqldb:mem:test_access
jdbc.user = ixmp
jdbc.pwd = ixmp

application.tag = IXSE_SR15
application.serverURL = http://localhost:8888

config.server.url = {auth_url}
config.server.config = DemoDB
config.server.username = service_user_dev
config.server.password = service_user_dev
6 changes: 3 additions & 3 deletions ixmp/tests/test_access.py
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ def test_check_single_model_access(mock, tmp_path, test_data_path, request):
test_props = create_test_platform(
tmp_path,
test_data_path,
f"{request.node.name}_access",
f"{request.node.name}",
auth_url=mock.pretend_url,
)

@@ -81,7 +81,7 @@ def test_check_single_model_access(mock, tmp_path, test_data_path, request):
assert not granted


def test_check_multi_model_access(mock, tmp_path, test_data_path):
def test_check_multi_model_access(mock, tmp_path, test_data_path, request):
mock.when(
"POST /access/list",
body='.+"test_user".+',
@@ -98,7 +98,7 @@ def test_check_multi_model_access(mock, tmp_path, test_data_path):
)

test_props = create_test_platform(
tmp_path, test_data_path, "access", auth_url=mock.pretend_url
tmp_path, test_data_path, f"{request.node.name}", auth_url=mock.pretend_url
)

mp = ixmp.Platform(backend="jdbc", dbprops=test_props)