diff --git a/integration/basic-stateless/customer_id b/integration/basic-stateless/customer_id deleted file mode 100644 index 4dc5a12fa..000000000 --- a/integration/basic-stateless/customer_id +++ /dev/null @@ -1 +0,0 @@ --Am-_6i5pw0u4AbspOwKN4lZUCn49u_G \ No newline at end of file diff --git a/integration/basic-stateless/installation_id b/integration/basic-stateless/installation_id deleted file mode 100644 index 215521d84..000000000 --- a/integration/basic-stateless/installation_id +++ /dev/null @@ -1 +0,0 @@ -RULNveQLrLj4GDum1yQhvKAcABh0GcLY \ No newline at end of file diff --git a/integration/basic-stateless/metadata.yaml b/integration/basic-stateless/metadata.yaml new file mode 100644 index 000000000..9d54e6b76 --- /dev/null +++ b/integration/basic-stateless/metadata.yaml @@ -0,0 +1,3 @@ +customer_id: "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G" +installation_id: "RULNveQLrLj4GDum1yQhvKAcABh0GcLY" +release_version: "0.0.4" \ No newline at end of file diff --git a/integration/basic-stateless/release_version b/integration/basic-stateless/release_version deleted file mode 100644 index 05b19b1f7..000000000 --- a/integration/basic-stateless/release_version +++ /dev/null @@ -1 +0,0 @@ -0.0.4 \ No newline at end of file diff --git a/integration/basic/customer_id b/integration/basic/customer_id deleted file mode 100644 index 4dc5a12fa..000000000 --- a/integration/basic/customer_id +++ /dev/null @@ -1 +0,0 @@ --Am-_6i5pw0u4AbspOwKN4lZUCn49u_G \ No newline at end of file diff --git a/integration/basic/installation_id b/integration/basic/installation_id deleted file mode 100644 index 215521d84..000000000 --- a/integration/basic/installation_id +++ /dev/null @@ -1 +0,0 @@ -RULNveQLrLj4GDum1yQhvKAcABh0GcLY \ No newline at end of file diff --git a/integration/basic/metadata.yaml b/integration/basic/metadata.yaml new file mode 100644 index 000000000..9d54e6b76 --- /dev/null +++ b/integration/basic/metadata.yaml @@ -0,0 +1,3 @@ +customer_id: "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G" +installation_id: "RULNveQLrLj4GDum1yQhvKAcABh0GcLY" +release_version: "0.0.4" \ No newline at end of file diff --git a/integration/basic/release_version b/integration/basic/release_version deleted file mode 100644 index 05b19b1f7..000000000 --- a/integration/basic/release_version +++ /dev/null @@ -1 +0,0 @@ -0.0.4 \ No newline at end of file diff --git a/integration/docker/customer_id b/integration/docker/customer_id deleted file mode 100644 index 4dc5a12fa..000000000 --- a/integration/docker/customer_id +++ /dev/null @@ -1 +0,0 @@ --Am-_6i5pw0u4AbspOwKN4lZUCn49u_G \ No newline at end of file diff --git a/integration/docker/installation_id b/integration/docker/installation_id deleted file mode 100644 index 215521d84..000000000 --- a/integration/docker/installation_id +++ /dev/null @@ -1 +0,0 @@ -RULNveQLrLj4GDum1yQhvKAcABh0GcLY \ No newline at end of file diff --git a/integration/docker/metadata.yaml b/integration/docker/metadata.yaml new file mode 100644 index 000000000..fda896793 --- /dev/null +++ b/integration/docker/metadata.yaml @@ -0,0 +1,3 @@ +customer_id: "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G" +installation_id: "RULNveQLrLj4GDum1yQhvKAcABh0GcLY" +release_version: "0.0.5" \ No newline at end of file diff --git a/integration/docker/release_version b/integration/docker/release_version deleted file mode 100644 index fa3de5865..000000000 --- a/integration/docker/release_version +++ /dev/null @@ -1 +0,0 @@ -0.0.5 \ No newline at end of file diff --git a/integration/integration_test.go b/integration/integration_test.go index d3b348158..6d1e63976 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -14,8 +14,15 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/replicatedhq/ship/pkg/cli" + "gopkg.in/yaml.v2" ) +type TestMetadata struct { + CustomerID string `yaml:"customer_id"` + InstallationID string `yaml:"installation_id"` + ReleaseVersion string `yaml:"release_version"` +} + func TestCore(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "integration") @@ -92,8 +99,7 @@ var _ = Describe("basic", func() { testPath := path.Join(integrationDir, file.Name()) testOutputPath := path.Join(testPath, "tmp") testInputPath := path.Join(testPath, "input") - - var customerID, installationID, releaseVersion string + var testMetadata TestMetadata BeforeEach(func() { // create a temporary directory within this directory to compare files with @@ -102,18 +108,11 @@ var _ = Describe("basic", func() { Expect(err).NotTo(HaveOccurred()) os.Chdir(testOutputPath) - // read the customer ID, installation ID and release version for this test - custIDBytes, err := ioutil.ReadFile(path.Join(testPath, "customer_id")) + // read the test metadata + metadataBytes, err := ioutil.ReadFile(path.Join(testPath, "metadata.yaml")) Expect(err).NotTo(HaveOccurred()) - customerID = string(custIDBytes) - - installationIDBytes, err := ioutil.ReadFile(path.Join(testPath, "installation_id")) - Expect(err).NotTo(HaveOccurred()) - installationID = string(installationIDBytes) - - releaseVersionBytes, err := ioutil.ReadFile(path.Join(testPath, "release_version")) + err = yaml.Unmarshal(metadataBytes, &testMetadata) Expect(err).NotTo(HaveOccurred()) - releaseVersion = string(releaseVersionBytes) }) AfterEach(func() { @@ -152,9 +151,9 @@ var _ = Describe("basic", func() { fmt.Sprintf("--state-file=%s", path.Join(testInputPath, ".ship/state.json")), "--customer-endpoint=https://pg.staging.replicated.com/graphql", "--log-level=off", - fmt.Sprintf("--customer-id=%s", customerID), - fmt.Sprintf("--installation-id=%s", installationID), - fmt.Sprintf("--release-semver=%s", releaseVersion), + fmt.Sprintf("--customer-id=%s", testMetadata.CustomerID), + fmt.Sprintf("--installation-id=%s", testMetadata.InstallationID), + fmt.Sprintf("--release-semver=%s", testMetadata.ReleaseVersion), })) err := cmd.Execute() Expect(err).NotTo(HaveOccurred())