Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
cd8b88f
Start introducing MockScheduler for better Scheduler testing
bpkroth May 19, 2025
2c9c968
fixup scheduler schemas refactor
bpkroth May 19, 2025
2f4a82e
reorg optimizer fixtures for reuse
bpkroth May 19, 2025
24ccf5a
reorg files based storage fixture
bpkroth May 19, 2025
bdfd9b0
adding basic scheduler config example loader test
bpkroth May 19, 2025
b66e17a
Refactor Scheduler schema definitions to make it easier to add new ones.
bpkroth May 19, 2025
30191c0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 19, 2025
bc8dc8f
Refactor some test fixtures for better reuse so we can test loading S…
bpkroth May 19, 2025
ea7b3ff
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 19, 2025
7563b8a
fixup
bpkroth May 19, 2025
b03e31c
lint
bpkroth May 19, 2025
8eb14c0
apply suggestions
bpkroth May 19, 2025
8ad4c3d
revert
bpkroth May 19, 2025
d4d5153
load test configs too
bpkroth May 19, 2025
1eb1acb
format
bpkroth May 19, 2025
947b759
Merge branch 'refactor/tests' into refactor/mock-scheduler-and-tests
bpkroth May 19, 2025
0c3c805
Merge branch 'refactor/scheduler-schemas' into refactor/mock-schedule…
bpkroth May 19, 2025
1112af4
list in __all__ so we load it as a part of tests schemas checking
bpkroth May 19, 2025
973ad2b
Merge branch 'main' into refactor/mock-scheduler-and-tests
bpkroth May 19, 2025
7a0d087
new mock scheduler schema and test configs
bpkroth May 19, 2025
dded243
refactor to split steps for easier hooking
bpkroth May 20, 2025
c305196
Merge remote-tracking branch 'upstream/main' into refactor/mock-sched…
bpkroth May 20, 2025
b16db23
Merge branch 'main' into refactor/mock-scheduler-and-tests
bpkroth May 20, 2025
f1fe022
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 20, 2025
83ff70f
Update mlos_bench/mlos_bench/tests/config/schedulers/test_load_schedu…
bpkroth May 20, 2025
71420e6
fixup
bpkroth May 20, 2025
70130ba
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 20, 2025
0a440a1
ignore the build tree in vscode
bpkroth May 20, 2025
efafc6f
adding more accessors
bpkroth May 22, 2025
842d393
wip: enable mock env to report arbitrary data
bpkroth May 22, 2025
19cec78
spelling
bpkroth May 22, 2025
175f315
refactor status parsing a little bit again
bpkroth May 22, 2025
7904716
extra test too
bpkroth May 22, 2025
54a96e8
more links
bpkroth May 22, 2025
2e1c4db
start adding a mock trial runner
bpkroth May 22, 2025
626554d
Revert "start adding a mock trial runner"
bpkroth May 22, 2025
b87c02a
schema work on mock trial data
bpkroth May 22, 2025
b4e5640
remove mock scheduler
bpkroth May 22, 2025
80cf2fa
allow mock trial data to be in the global config as well
bpkroth May 22, 2025
8426621
comments as prompts in preparation to run a trial
bpkroth May 22, 2025
cdc614f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 22, 2025
b3f49e9
fixups
bpkroth May 22, 2025
a41e85f
revert
bpkroth May 22, 2025
63e0f88
remove
bpkroth May 22, 2025
44bdde2
refactor status parsing a little bit again
bpkroth May 22, 2025
607fffd
extra test too
bpkroth May 22, 2025
aaf0842
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 22, 2025
8f472bb
revert
bpkroth May 22, 2025
8a4aac2
comments
bpkroth May 22, 2025
50ffde4
add accessor for the mock_trial_data property
bpkroth May 22, 2025
b1e2a52
make it a property
bpkroth May 22, 2025
f0f7c4c
add some basic fixtures to get started with
bpkroth May 22, 2025
c27b3c2
add a method for creating schedulers, intended to be used with pytest…
bpkroth May 22, 2025
9813268
stubbing out a very basic test to get started
bpkroth May 22, 2025
3b92017
wip: testing
bpkroth May 22, 2025
341564e
wip
bpkroth May 22, 2025
5c06814
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 22, 2025
836dcd9
comments
bpkroth May 22, 2025
0072141
fixups
bpkroth May 22, 2025
5400bd6
more checks
bpkroth May 22, 2025
e62a378
Add more checks
bpkroth May 22, 2025
206bb77
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 22, 2025
abe412b
linting
bpkroth May 22, 2025
f5cb468
doc tweaks
bpkroth May 22, 2025
c047bc2
Merge branch 'refactor/parse-status' into refactor/mock-scheduler-and…
bpkroth May 22, 2025
dc7a7b2
fixup
bpkroth May 22, 2025
76e94ed
fixup
bpkroth May 22, 2025
7f8522a
fixups
bpkroth May 22, 2025
9e03e63
remove old files
bpkroth May 22, 2025
f9e3339
add some common globals
bpkroth May 22, 2025
a05b5ae
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 22, 2025
94e31b5
simplify
bpkroth May 27, 2025
21e49db
rename
bpkroth May 27, 2025
46be004
fixup
bpkroth May 27, 2025
01f7a02
always try and convert metrics back to numerics if possible
bpkroth May 27, 2025
b035e57
wip: tell mysql to use a datetime that can store fractional seconds
bpkroth May 27, 2025
ca101ef
add more trial data for testing
bpkroth May 27, 2025
98ec1cc
:type fixups
bpkroth May 27, 2025
82f602c
check the telemetry
bpkroth May 27, 2025
176480f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 27, 2025
22f4e79
revert the bulk conversion one
bpkroth May 27, 2025
aa9f728
debugging
bpkroth May 27, 2025
6289216
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 27, 2025
5be025e
Merge branch 'main' into refactor/mock-scheduler-and-tests
bpkroth Jun 5, 2025
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
stubbing out a very basic test to get started
  • Loading branch information
bpkroth committed May 22, 2025
commit 981326890418e4ba170fdf647e7b5c69decd91af
36 changes: 36 additions & 0 deletions mlos_bench/mlos_bench/tests/schedulers/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

import pytest
import unittest.mock
import sys

from mlos_bench.environments.mock_env import MockEnv
from mlos_bench.storage.sql.storage import SqlStorage
from mlos_bench.schedulers.base_scheduler import Scheduler
from mlos_bench.schedulers.sync_scheduler import SyncScheduler
Expand Down Expand Up @@ -36,3 +38,37 @@ def create_scheduler(
storage=sqlite_storage,
root_env_config="",
)


@pytest.mark.parametrize(
"scheduler_class",
[
SyncScheduler,
],
)
@pytest.mark.skipif(
sys.platform == "win32",
reason="Skipping test on Windows - SQLite storage is not accessible in parallel tests there.",
)
def test_scheduler(
scheduler_class: type[Scheduler],
# fixtures:
trial_runners: list[TrialRunner],
mock_opt: MockOptimizer,
sqlite_storage: SqlStorage,
) -> None:
"""
Test the creation of a SyncScheduler instance.
"""
scheduler = create_scheduler(
scheduler_class,
trial_runners,
mock_opt,
sqlite_storage,
)
assert isinstance(scheduler, scheduler_class)
assert isinstance(scheduler.trial_runners, list)
assert len(scheduler.trial_runners) == len(trial_runners)
assert isinstance(scheduler.optimizer, MockOptimizer)
assert isinstance(scheduler.storage, SqlStorage)
assert isinstance(scheduler.root_environment, MockEnv)