-
Notifications
You must be signed in to change notification settings - Fork 70
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
fix dag deploy updating on accident #1523
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1285,15 +1285,16 @@ func TestUpdate(t *testing.T) { //nolint | |
// Mock user input for deployment name | ||
defer testUtil.MockUserInput(t, "1")() | ||
|
||
// success with hybrid type | ||
// success with hybrid type in this test nothing is being change just ensuring that dag deploy stays true. Addtionally no deployment id/name is given so user input is needed to select one | ||
err := Update("", "", ws, "", "", "", CeleryExecutor, "", "", "", "", "", "", "", 0, 0, workerQueueRequest, hybridQueueList, newEnvironmentVariables, true, mockCoreClient, mockPlatformCoreClient) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a comment up here w.r.t to what are we updating? Eventually would want to get rid of that huge list of arguments and have defined input type, but we can do that later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added comments |
||
assert.NoError(t, err) | ||
assert.Equal(t, deploymentResponse.JSON200.IsDagDeployEnabled, dagDeployEnabled) | ||
|
||
// Mock user input for deployment name | ||
// defer testUtil.MockUserInput(t, "1")() | ||
defer testUtil.MockUserInput(t, "y")() | ||
|
||
// kubernetes executor | ||
// success updating the kubernetes executor on hybrid type. deployment name is given | ||
err = Update("test-id-1", "", ws, "", "", "", KubeExecutor, "", "", "", "", "", "", "", 0, 0, workerQueueRequest, hybridQueueList, newEnvironmentVariables, false, mockCoreClient, mockPlatformCoreClient) | ||
assert.NoError(t, err) | ||
|
||
|
@@ -1305,14 +1306,15 @@ func TestUpdate(t *testing.T) { //nolint | |
// defer testUtil.MockUserInput(t, "1")() | ||
defer testUtil.MockUserInput(t, "y")() | ||
|
||
// success with standard type | ||
// success with standard type and deployment name input and dag deploy stays the same | ||
err = Update("test-id-1", "", ws, "", "", "", CeleryExecutor, "", "", "", "", "", "", "", 0, 0, workerQueueRequest, hybridQueueList, newEnvironmentVariables, false, mockCoreClient, mockPlatformCoreClient) | ||
assert.NoError(t, err) | ||
assert.Equal(t, deploymentResponse.JSON200.IsDagDeployEnabled, dagDeployEnabled) | ||
|
||
// Mock user input for deployment name | ||
defer testUtil.MockUserInput(t, "y")() | ||
|
||
// kubernetes executor | ||
// success updating to kubernetes executor on standard type | ||
err = Update("test-id-1", "", ws, "", "", "", KubeExecutor, "", "", "", "", "", "", "", 0, 0, workerQueueRequest, hybridQueueList, newEnvironmentVariables, false, mockCoreClient, mockPlatformCoreClient) | ||
assert.NoError(t, err) | ||
|
||
|
@@ -1322,14 +1324,16 @@ func TestUpdate(t *testing.T) { //nolint | |
// Mock user input for deployment name | ||
// defer testUtil.MockUserInput(t, "1")() | ||
|
||
// success with dedicated type | ||
// success with dedicated type no changes made asserts that dag deploy stays the same | ||
err = Update("test-id-1", "", ws, "", "", "", CeleryExecutor, "", "", "", "", "", "", "", 0, 0, workerQueueRequest, hybridQueueList, newEnvironmentVariables, false, mockCoreClient, mockPlatformCoreClient) | ||
assert.NoError(t, err) | ||
assert.Equal(t, deploymentResponse.JSON200.IsDagDeployEnabled, dagDeployEnabled) | ||
|
||
// Mock user input for deployment name | ||
defer testUtil.MockUserInput(t, "y")() | ||
|
||
// kubernetes executor | ||
err = Update("test-id-1", "", ws, "", "", "", "", "", "", "", "", "", "", "", 0, 0, workerQueueRequest, hybridQueueList, newEnvironmentVariables, false, mockCoreClient, mockPlatformCoreClient) | ||
// success with dedicated updating to kubernetes executor | ||
err = Update("test-id-1", "", ws, "", "", "", KubeExecutor, "", "", "", "", "", "", "", 0, 0, workerQueueRequest, hybridQueueList, newEnvironmentVariables, false, mockCoreClient, mockPlatformCoreClient) | ||
assert.NoError(t, err) | ||
mockCoreClient.AssertExpectations(t) | ||
mockPlatformCoreClient.AssertExpectations(t) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what was the reasoning behind putting it up here, it seems to fit the style of code the way we had it before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need it exist outside of the function so we can assert that it is the right value in the test