Skip to content

Commit c66d22a

Browse files
FIX CI Final Final Final Final (openml#1417)
* fix: test that might have a race condition now * maint: make sure workflow does not fail if there is nothing to push.
1 parent 94116e7 commit c66d22a

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,10 @@ jobs:
6060
git config --global user.name 'Github Actions'
6161
git config --global user.email 'not@mail.com'
6262
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
63-
git commit -am "$last_commit"
64-
git diff --quiet @{u} HEAD || git push
63+
# Only commit and push if there are changes
64+
if ! git diff --cached --quiet; then
65+
git commit -m "$last_commit"
66+
git push
67+
else
68+
echo "Branch is up to date with origin/gh-pages, no need to update docs. Skipping."
69+
fi

tests/test_openml/test_config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_non_writable_home(self, log_handler_mock, warnings_mock):
5454
assert not log_handler_mock.call_args_list[0][1]["create_file_handler"]
5555
assert openml.config._root_cache_directory == Path(td) / "something-else"
5656

57-
@unittest.skipIf(platform.system() != "Linux","XDG only exists for Linux systems.")
57+
@unittest.skipIf(platform.system() != "Linux", "XDG only exists for Linux systems.")
5858
def test_XDG_directories_do_not_exist(self):
5959
with tempfile.TemporaryDirectory(dir=self.workdir) as td:
6060
# Save previous state
@@ -131,8 +131,11 @@ def test_switch_from_example_configuration(self):
131131
assert openml.config.server == self.production_server
132132

133133
def test_example_configuration_stop_before_start(self):
134-
"""Verifies an error is raised is `stop_...` is called before `start_...`."""
134+
"""Verifies an error is raised if `stop_...` is called before `start_...`."""
135135
error_regex = ".*stop_use_example_configuration.*start_use_example_configuration.*first"
136+
# Tests do not reset the state of this class. Thus, we ensure it is in
137+
# the original state before the test.
138+
openml.config.ConfigurationForExamples._start_last_called = False
136139
self.assertRaisesRegex(
137140
RuntimeError,
138141
error_regex,

0 commit comments

Comments
 (0)