From 675b0f6e35d3d928c9dda57545add18b5bb79d7b Mon Sep 17 00:00:00 2001 From: LennartPurucker Date: Wed, 18 Jun 2025 16:41:20 +0200 Subject: [PATCH 1/2] fix: test that might have a race condition now --- tests/test_openml/test_config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_openml/test_config.py b/tests/test_openml/test_config.py index f9ab5eb9f..53d4abe77 100644 --- a/tests/test_openml/test_config.py +++ b/tests/test_openml/test_config.py @@ -54,7 +54,7 @@ def test_non_writable_home(self, log_handler_mock, warnings_mock): assert not log_handler_mock.call_args_list[0][1]["create_file_handler"] assert openml.config._root_cache_directory == Path(td) / "something-else" - @unittest.skipIf(platform.system() != "Linux","XDG only exists for Linux systems.") + @unittest.skipIf(platform.system() != "Linux", "XDG only exists for Linux systems.") def test_XDG_directories_do_not_exist(self): with tempfile.TemporaryDirectory(dir=self.workdir) as td: # Save previous state @@ -131,8 +131,11 @@ def test_switch_from_example_configuration(self): assert openml.config.server == self.production_server def test_example_configuration_stop_before_start(self): - """Verifies an error is raised is `stop_...` is called before `start_...`.""" + """Verifies an error is raised if `stop_...` is called before `start_...`.""" error_regex = ".*stop_use_example_configuration.*start_use_example_configuration.*first" + # Tests do not reset the state of this class. Thus, we ensure it is in + # the original state before the test. + openml.config.ConfigurationForExamples._start_last_called = False self.assertRaisesRegex( RuntimeError, error_regex, From 48a48c94ad79cecbd8b15ae7f353190c1f001489 Mon Sep 17 00:00:00 2001 From: LennartPurucker Date: Wed, 18 Jun 2025 16:41:52 +0200 Subject: [PATCH 2/2] maint: make sure workflow does not fail if there is nothing to push. --- .github/workflows/docs.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 773dda6f2..3b13c9908 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -60,5 +60,10 @@ jobs: git config --global user.name 'Github Actions' git config --global user.email 'not@mail.com' git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} - git commit -am "$last_commit" - git diff --quiet @{u} HEAD || git push + # Only commit and push if there are changes + if ! git diff --cached --quiet; then + git commit -m "$last_commit" + git push + else + echo "Branch is up to date with origin/gh-pages, no need to update docs. Skipping." + fi