From 79b9d876867d0e113d239ad6e833577a91b93811 Mon Sep 17 00:00:00 2001 From: architmallik7 Date: Thu, 19 Dec 2024 13:36:48 +0530 Subject: [PATCH] Added New Testcases --- convert/drone/convert_test.go | 2 +- convert/drone/testdatav1/examples/drone.yaml | 23 +++++++++++++++++ .../testdatav1/examples/drone.yaml.golden | 25 +++++++++++++++++++ convert/drone/testdatav1/examples/step.yaml | 19 ++++++++++++++ .../testdatav1/examples/step.yaml.golden | 21 ++++++++++++++++ 5 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 convert/drone/testdatav1/examples/drone.yaml create mode 100644 convert/drone/testdatav1/examples/drone.yaml.golden create mode 100644 convert/drone/testdatav1/examples/step.yaml create mode 100644 convert/drone/testdatav1/examples/step.yaml.golden diff --git a/convert/drone/convert_test.go b/convert/drone/convert_test.go index 5812ad9e..eaeb9fcf 100644 --- a/convert/drone/convert_test.go +++ b/convert/drone/convert_test.go @@ -24,7 +24,7 @@ import ( ) func TestConvert(t *testing.T) { - tests, err := filepath.Glob("testdata/examples/*.yaml") + tests, err := filepath.Glob("testdatav1/examples/*.yaml") if err != nil { t.Error(err) return diff --git a/convert/drone/testdatav1/examples/drone.yaml b/convert/drone/testdatav1/examples/drone.yaml new file mode 100644 index 00000000..4d5c55be --- /dev/null +++ b/convert/drone/testdatav1/examples/drone.yaml @@ -0,0 +1,23 @@ +--- +kind: pipeline +type: docker +name: default + +steps: +- name: backend + image: golang + environment: + PLUGIN_LOG_LEVEL: info + PLUGIN_ARTIFACT_REGION: us-east-1 + PLUGIN_ARTIFACT_BUCKET_NAME: unified-versioning-bucket + commands: + - go build + - go test + +- name: frontend + image: node + commands: + - npm install + - npm run test + +... \ No newline at end of file diff --git a/convert/drone/testdatav1/examples/drone.yaml.golden b/convert/drone/testdatav1/examples/drone.yaml.golden new file mode 100644 index 00000000..cfa6de86 --- /dev/null +++ b/convert/drone/testdatav1/examples/drone.yaml.golden @@ -0,0 +1,25 @@ +pipeline: + stages: + - clone: + disabled: true + name: default + runtime: machine + steps: + - name: backend + run: + container: + image: golang + env: + PLUGIN_ARTIFACT_BUCKET_NAME: unified-versioning-bucket + PLUGIN_ARTIFACT_REGION: us-east-1 + PLUGIN_LOG_LEVEL: info + script: |- + go build + go test + - name: frontend + run: + container: + image: node + script: |- + npm install + npm run test \ No newline at end of file diff --git a/convert/drone/testdatav1/examples/step.yaml b/convert/drone/testdatav1/examples/step.yaml new file mode 100644 index 00000000..546f1b2f --- /dev/null +++ b/convert/drone/testdatav1/examples/step.yaml @@ -0,0 +1,19 @@ +--- +kind: pipeline +type: docker +name: default + +steps: +- name: backend + image: golang + commands: + - go build + - go test + +- name: frontend + image: node + commands: + - npm install + - npm run test + +... \ No newline at end of file diff --git a/convert/drone/testdatav1/examples/step.yaml.golden b/convert/drone/testdatav1/examples/step.yaml.golden new file mode 100644 index 00000000..12a4cbe3 --- /dev/null +++ b/convert/drone/testdatav1/examples/step.yaml.golden @@ -0,0 +1,21 @@ +pipeline: + stages: + - clone: + disabled: true + name: default + runtime: machine + steps: + - name: backend + run: + container: + image: golang + script: |- + go build + go test + - name: frontend + run: + container: + image: node + script: |- + npm install + npm run test \ No newline at end of file