Skip to content

Tests refactoring#1055

Merged
spirali merged 2 commits intomainfrom
tests-refactoring
Jan 30, 2026
Merged

Tests refactoring#1055
spirali merged 2 commits intomainfrom
tests-refactoring

Conversation

@spirali
Copy link
Collaborator

@spirali spirali commented Jan 28, 2026

Refactoring of Tako tests.

  • Tests unified over TestEnv, with few execeptions that test lowlevel stuff, all tests should construct core via TestEnv.
  • Removed some pre-TestEnv helper functions for populating core
  • TaskBuilder does not take ID; ID is attached when task is inserted into core. It allows to reuse task definition.
  • WorkerBuilder introduced; ad-hoc worker configuration creation replaced by this builder

Copy link
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It certainly looks like an improvement! I wonder if you'll feel the urge to refactor it further after my talk 😆

assert_eq!(r.n_enabled_variants(), 0);

let task = TaskBuilder::new(task_id)
let task = TaskBuilder::new()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if there was some test context from which you create the task builder, and it assigns the task id automatically, rather than choosing the ID manually in tests :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan this but in the next iteration during integrating of scheduler-v2, because lots of current scheduler tests will be written differently.

submit_test_tasks(&mut core, vec![a, b, c, d, e]);

let mut rt = TestEnv::new();
let a = rt.new_task_default(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 I feel like you were reading my slides.

@spirali spirali merged commit 009e97b into main Jan 30, 2026
9 checks passed
@spirali spirali deleted the tests-refactoring branch January 30, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants