-
Notifications
You must be signed in to change notification settings - Fork 1.2k
CHASM Scheduler Experimental Flag #8467
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9a6f00f
good start
chaptersix 26f4e67
diff approach
chaptersix d040428
update based on comments
chaptersix 112905c
add tests and remove testify suite
chaptersix e318b3c
remove unused import
chaptersix ca2ef67
add some more tests
chaptersix 06534e3
Apply suggestion from @chaptersix
chaptersix 30a708f
Apply suggestion from @chaptersix
chaptersix e42eda8
Rename FrontendEnabledExperiments to FrontendAllowedExperiments and f…
chaptersix 06d062a
updates based on pr comments
chaptersix 3ba2dc7
Apply suggestion from @chaptersix
chaptersix 91804d5
Apply suggestion from @chaptersix
chaptersix eb28f0f
Apply suggestion from @chaptersix
chaptersix ebcfe9d
Apply suggestion from @chaptersix
chaptersix c7bfe27
modify based on comments (tests are probably failing)
chaptersix 943ac2b
remove sample config for allowed experiments
chaptersix 1c7bf6c
few more fixes
chaptersix c64ed9b
fix build error
chaptersix a0a4307
Fix lint errors by adding ignore comments
chaptersix 4eaffcd
Merge remote-tracking branch 'origin/main' into alex/schv2_exp
chaptersix ba807d0
fix unit and lint
chaptersix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| package frontend | ||
chaptersix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const ( | ||
| // ChasmSchedulerExperiment is the experiment name for enabling CHASM (V2) scheduler | ||
| ChasmSchedulerExperiment = "chasm-scheduler" | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| package frontend | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestConfig_IsExperimentAllowed(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| tests := []struct { | ||
| name string | ||
| namespace string | ||
| experiment string | ||
| setupFunc func(namespace string) []string | ||
| expected bool | ||
| }{ | ||
| { | ||
| name: "no experiments allowed", | ||
| namespace: "test-namespace", | ||
| experiment: "chasm-scheduler", | ||
| setupFunc: func(ns string) []string { return []string{} }, | ||
| expected: false, | ||
| }, | ||
| { | ||
| name: "specific experiment match", | ||
| namespace: "test-namespace", | ||
| experiment: "chasm-scheduler", | ||
| setupFunc: func(ns string) []string { return []string{"chasm-scheduler"} }, | ||
| expected: true, | ||
| }, | ||
| { | ||
| name: "specific experiment no match", | ||
| namespace: "test-namespace", | ||
| experiment: "other-experiment", | ||
| setupFunc: func(ns string) []string { return []string{"chasm-scheduler"} }, | ||
| expected: false, | ||
| }, | ||
| { | ||
| name: "wildcard allows any", | ||
| namespace: "test-namespace", | ||
| experiment: "any-experiment", | ||
| setupFunc: func(ns string) []string { return []string{"*"} }, | ||
| expected: true, | ||
| }, | ||
| { | ||
| name: "namespace specific wildcard", | ||
| namespace: "ns-with-wildcard", | ||
| experiment: "any-experiment", | ||
| setupFunc: func(ns string) []string { | ||
| if ns == "ns-with-wildcard" { | ||
| return []string{"*"} | ||
| } | ||
| return nil | ||
| }, | ||
| expected: true, | ||
| }, | ||
| { | ||
| name: "namespace specific match", | ||
| namespace: "ns-with-specific", | ||
| experiment: "chasm-scheduler", | ||
| setupFunc: func(ns string) []string { | ||
| if ns == "ns-with-specific" { | ||
| return []string{"chasm-scheduler"} | ||
| } | ||
| return nil | ||
| }, | ||
| expected: true, | ||
| }, | ||
| } | ||
|
|
||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| config := &Config{ | ||
| AllowedExperiments: tt.setupFunc, | ||
| } | ||
|
|
||
| result := config.IsExperimentAllowed(tt.experiment, tt.namespace) | ||
| require.Equal(t, tt.expected, result) | ||
| }) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.