Skip to content

Commit

Permalink
remove conflict test (#1336)
Browse files Browse the repository at this point in the history
* remove conflict test

* fix test
  • Loading branch information
sunkickr authored and kushalmalani committed Aug 3, 2023
1 parent 595721e commit cf26ce3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
3 changes: 1 addition & 2 deletions airflow/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,7 @@ func (d *DockerCompose) Pytest(pytestFile, customImageName, deployImageName, pyt

func (d *DockerCompose) UpgradeTest(newAirflowVersion, deploymentID, newImageName, customImage string, conflictTest, versionTest, dagTest bool, client astro.Client) error {
// figure out which tests to run
if !conflictTest && !versionTest && !dagTest {
conflictTest = true
if !versionTest && !dagTest {
versionTest = true
dagTest = true
}
Expand Down
26 changes: 13 additions & 13 deletions airflow/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err := mockDockerCompose.UpgradeTest("new-version", "", "", "", false, false, false, nil)
err := mockDockerCompose.UpgradeTest("new-version", "", "", "", true, false, false, nil)

assert.NoError(t, err)
imageHandler.AssertExpectations(t)
Expand All @@ -1129,7 +1129,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err := mockDockerCompose.UpgradeTest("new-version", "deployment-id", "", "", false, false, false, mockClient)
err := mockDockerCompose.UpgradeTest("new-version", "deployment-id", "", "", true, false, false, mockClient)

assert.NoError(t, err)
imageHandler.AssertExpectations(t)
Expand All @@ -1141,7 +1141,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "", "", "", false, false, false, nil)
err = mockDockerCompose.UpgradeTest("new-version", "", "", "", true, false, false, nil)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand All @@ -1153,7 +1153,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "", "", "", false, false, false, nil)
err = mockDockerCompose.UpgradeTest("new-version", "", "", "", true, false, false, nil)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand All @@ -1165,7 +1165,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "", "", "", false, false, false, nil)
err = mockDockerCompose.UpgradeTest("new-version", "", "", "", true, false, false, nil)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand All @@ -1178,7 +1178,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "", "", "", false, false, false, nil)
err = mockDockerCompose.UpgradeTest("new-version", "", "", "", true, false, false, nil)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand All @@ -1192,7 +1192,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "", "", "", false, false, false, nil)
err = mockDockerCompose.UpgradeTest("new-version", "", "", "", true, false, false, nil)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand All @@ -1207,7 +1207,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "", "", "", false, false, false, nil)
err = mockDockerCompose.UpgradeTest("new-version", "", "", "", true, false, false, nil)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand All @@ -1223,7 +1223,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "", "", "", false, false, false, nil)
err = mockDockerCompose.UpgradeTest("new-version", "", "", "", true, false, false, nil)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand All @@ -1239,7 +1239,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "", "", "", false, false, false, nil)
err = mockDockerCompose.UpgradeTest("new-version", "", "", "", true, false, false, nil)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand All @@ -1251,7 +1251,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "deployment-id", "", "", false, false, false, mockClient)
err = mockDockerCompose.UpgradeTest("new-version", "deployment-id", "", "", true, false, false, mockClient)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand All @@ -1264,7 +1264,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "deployment-id", "", "", false, false, false, mockClient)
err = mockDockerCompose.UpgradeTest("new-version", "deployment-id", "", "", true, false, false, mockClient)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand All @@ -1279,7 +1279,7 @@ func TestDockerComposedUpgradeTest(t *testing.T) {

mockDockerCompose.imageHandler = imageHandler

err = mockDockerCompose.UpgradeTest("new-version", "", "", "", false, false, false, nil)
err = mockDockerCompose.UpgradeTest("new-version", "", "", "", true, false, false, nil)
assert.Error(t, err)
imageHandler.AssertExpectations(t)
})
Expand Down
1 change: 0 additions & 1 deletion cmd/airflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ func newAirflowUpgradeTestCmd(astroClient astro.Client) *cobra.Command {
},
}
cmd.Flags().StringVarP(&airflowVersion, "airflow-version", "a", "", "The version of Airflow you want to upgrade to. The default is the latest available version. Tests are run against the equivalent Astro Runtime version. ")
cmd.Flags().BoolVarP(&conflictTest, "conflict-test", "c", false, "Only run conflict tests. These tests check whether you will have dependency conflicts after you upgrade.")
cmd.Flags().BoolVarP(&versionTest, "version-test", "", false, "Only run version tests. These tests show you how the versions of your dependencies will change after you upgrade.")
cmd.Flags().BoolVarP(&dagTest, "dag-test", "d", false, "Only run DAG tests. These tests check whether your DAGs will generate import errors after you upgrade.")
cmd.Flags().StringVarP(&deploymentID, "deployment-id", "i", "", "ID of the Deployment you want run dependency tests against.")
Expand Down

0 comments on commit cf26ce3

Please sign in to comment.