From cf26ce3aa666c604320879bf9349e9e041ccf2ea Mon Sep 17 00:00:00 2001 From: David Koenitzer Date: Thu, 3 Aug 2023 12:31:46 -0400 Subject: [PATCH] remove conflict test (#1336) * remove conflict test * fix test --- airflow/docker.go | 3 +-- airflow/docker_test.go | 26 +++++++++++++------------- cmd/airflow.go | 1 - 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/airflow/docker.go b/airflow/docker.go index 10038e267..1b92e7451 100644 --- a/airflow/docker.go +++ b/airflow/docker.go @@ -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 } diff --git a/airflow/docker_test.go b/airflow/docker_test.go index 28d1975bc..cac4c22d2 100644 --- a/airflow/docker_test.go +++ b/airflow/docker_test.go @@ -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) @@ -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) @@ -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) }) @@ -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) }) @@ -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) }) @@ -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) }) @@ -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) }) @@ -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) }) @@ -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) }) @@ -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) }) @@ -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) }) @@ -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) }) @@ -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) }) diff --git a/cmd/airflow.go b/cmd/airflow.go index 8d7970232..2642e869b 100644 --- a/cmd/airflow.go +++ b/cmd/airflow.go @@ -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.")