From fcbdfe178ae7aa73eca7af9f24b1c0812280fa53 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Wed, 9 Jun 2021 19:08:03 +0000 Subject: [PATCH] Move universe integration tests to universe dir. Signed-off-by: Solomon Hykes --- Makefile | 9 +++- .../.dagger/env/aws-ecr}/.gitignore | 0 .../.dagger/env/aws-ecr}/plan/ecr.cue | 0 .../.dagger/env/aws-ecr}/values.yaml | 6 +-- .../.dagger/env/aws-s3}/.gitignore | 0 .../.dagger/env/aws-s3}/plan/s3.cue | 0 .../.dagger/env/aws-s3}/plan/verify.cue | 0 .../.dagger/env/aws-s3}/values.yaml | 9 ++-- .../.dagger/env/docker-run-local}/.gitignore | 0 .../env/docker-run-local/plan/local.cue | 15 +++++++ .../.dagger/env/docker-run-local}/values.yaml | 6 +-- .../env/docker-run-ssh-passphrase}/.gitignore | 0 .../plan/passphrase.cue | 0 .../docker-run-ssh-passphrase}/values.yaml | 6 +-- .../.gitignore | 0 .../plan/wrong-passphrase.cue | 0 .../values.yaml | 6 +-- .../.dagger/env/docker-run-ssh}/.gitignore | 0 .../env/docker-run-ssh}/plan/simple.cue | 0 .../.dagger/env/docker-run-ssh}/values.yaml | 6 +-- .../.dagger/env/google-gcr}/.gitignore | 0 .../.dagger/env/google-gcr}/plan/gcr.cue | 0 .../.dagger/env/google-gcr}/values.yaml | 6 +-- .../.dagger/env/google-gke}/.gitignore | 0 .../.dagger/env/google-gke}/plan/gke.cue | 0 .../.dagger/env/google-gke}/values.yaml | 6 +-- .../.dagger/env/netlify}/.gitignore | 0 .../.dagger/env/netlify}/plan/netlify.cue | 0 .../.dagger/env/netlify}/values.yaml | 6 +-- stdlib/.gitignore | 2 + .../aws/s3/testdata/bar/foo.txt | 0 .../aws/s3/testdata/dirFile.txt | 0 stdlib/package.json | 11 +++++ stdlib/universe.bats | 45 +++++++++++++++++++ stdlib/yarn.lock | 15 +++++++ tests/stdlib.bats | 43 ------------------ .../local/.dagger/env/default/plan/local.cue | 18 -------- 37 files changed, 124 insertions(+), 91 deletions(-) rename {tests/stdlib/aws/ecr/.dagger/env/default => stdlib/.dagger/env/aws-ecr}/.gitignore (100%) rename {tests/stdlib/aws/ecr/.dagger/env/default => stdlib/.dagger/env/aws-ecr}/plan/ecr.cue (100%) rename {tests/stdlib/aws/ecr/.dagger/env/default => stdlib/.dagger/env/aws-ecr}/values.yaml (76%) rename {tests/stdlib/aws/s3/.dagger/env/default => stdlib/.dagger/env/aws-s3}/.gitignore (100%) rename {tests/stdlib/aws/s3/.dagger/env/default => stdlib/.dagger/env/aws-s3}/plan/s3.cue (100%) rename {tests/stdlib/aws/s3/.dagger/env/default => stdlib/.dagger/env/aws-s3}/plan/verify.cue (100%) rename {tests/stdlib/aws/s3/.dagger/env/default => stdlib/.dagger/env/aws-s3}/values.yaml (74%) rename {tests/stdlib/docker/run/local/.dagger/env/default => stdlib/.dagger/env/docker-run-local}/.gitignore (100%) create mode 100644 stdlib/.dagger/env/docker-run-local/plan/local.cue rename {tests/stdlib/docker/run/local/.dagger/env/default => stdlib/.dagger/env/docker-run-local}/values.yaml (66%) rename {tests/stdlib/docker/run/ssh-passphrase/.dagger/env/default => stdlib/.dagger/env/docker-run-ssh-passphrase}/.gitignore (100%) rename {tests/stdlib/docker/run/ssh-passphrase/.dagger/env/default => stdlib/.dagger/env/docker-run-ssh-passphrase}/plan/passphrase.cue (100%) rename {tests/stdlib/docker/run/ssh-passphrase/.dagger/env/default => stdlib/.dagger/env/docker-run-ssh-passphrase}/values.yaml (82%) rename {tests/stdlib/docker/run/ssh-wrong-passphrase/.dagger/env/default => stdlib/.dagger/env/docker-run-ssh-wrong-passphrase}/.gitignore (100%) rename {tests/stdlib/docker/run/ssh-wrong-passphrase/.dagger/env/default => stdlib/.dagger/env/docker-run-ssh-wrong-passphrase}/plan/wrong-passphrase.cue (100%) rename {tests/stdlib/docker/run/ssh-wrong-passphrase/.dagger/env/default => stdlib/.dagger/env/docker-run-ssh-wrong-passphrase}/values.yaml (82%) rename {tests/stdlib/docker/run/ssh/.dagger/env/default => stdlib/.dagger/env/docker-run-ssh}/.gitignore (100%) rename {tests/stdlib/docker/run/ssh/.dagger/env/default => stdlib/.dagger/env/docker-run-ssh}/plan/simple.cue (100%) rename {tests/stdlib/docker/run/ssh/.dagger/env/default => stdlib/.dagger/env/docker-run-ssh}/values.yaml (81%) rename {tests/stdlib/gcp/gcr/.dagger/env/default => stdlib/.dagger/env/google-gcr}/.gitignore (100%) rename {tests/stdlib/gcp/gcr/.dagger/env/default => stdlib/.dagger/env/google-gcr}/plan/gcr.cue (100%) rename {tests/stdlib/gcp/gcr/.dagger/env/default => stdlib/.dagger/env/google-gcr}/values.yaml (92%) rename {tests/stdlib/gcp/gke/.dagger/env/default => stdlib/.dagger/env/google-gke}/.gitignore (100%) rename {tests/stdlib/gcp/gke/.dagger/env/default => stdlib/.dagger/env/google-gke}/plan/gke.cue (100%) rename {tests/stdlib/gcp/gke/.dagger/env/default => stdlib/.dagger/env/google-gke}/values.yaml (92%) rename {tests/stdlib/netlify/.dagger/env/default => stdlib/.dagger/env/netlify}/.gitignore (100%) rename {tests/stdlib/netlify/.dagger/env/default => stdlib/.dagger/env/netlify}/plan/netlify.cue (100%) rename {tests/stdlib/netlify/.dagger/env/default => stdlib/.dagger/env/netlify}/values.yaml (74%) create mode 100644 stdlib/.gitignore rename {tests/stdlib => stdlib}/aws/s3/testdata/bar/foo.txt (100%) rename {tests/stdlib => stdlib}/aws/s3/testdata/dirFile.txt (100%) create mode 100644 stdlib/package.json create mode 100644 stdlib/universe.bats create mode 100644 stdlib/yarn.lock delete mode 100644 tests/stdlib/docker/run/local/.dagger/env/default/plan/local.cue diff --git a/Makefile b/Makefile index 1e2cc1ba..34ff7bae 100644 --- a/Makefile +++ b/Makefile @@ -40,12 +40,19 @@ check-buildkit-version: || { echo buildkit version mismatch go.mod != util/buildkitd/buildkitd.go ; exit 1; } .PHONY: integration -integration: dagger-debug +integration: dagger-debug universe-test $(shell command -v sops > /dev/null || { echo "You need sops. On macOS: brew install sops"; exit 1; }) $(shell command -v parallel > /dev/null || { echo "You need gnu parallel. On macOS: brew install parallel"; exit 1; }) yarn --cwd "./tests" install DAGGER_BINARY="../cmd/dagger/dagger-debug" yarn --cwd "./tests" test +.PHONY: universe-test +universe-test: dagger-debug + $(shell command -v sops > /dev/null || { echo "You need sops. On macOS: brew install sops"; exit 1; }) + $(shell command -v parallel > /dev/null || { echo "You need gnu parallel. On macOS: brew install parallel"; exit 1; }) + yarn --cwd "./universe" install + DAGGER_BINARY="../cmd/dagger/dagger-debug" yarn --cwd "./universe" test + .PHONY: install install: dagger go install ./cmd/dagger diff --git a/tests/stdlib/aws/ecr/.dagger/env/default/.gitignore b/stdlib/.dagger/env/aws-ecr/.gitignore similarity index 100% rename from tests/stdlib/aws/ecr/.dagger/env/default/.gitignore rename to stdlib/.dagger/env/aws-ecr/.gitignore diff --git a/tests/stdlib/aws/ecr/.dagger/env/default/plan/ecr.cue b/stdlib/.dagger/env/aws-ecr/plan/ecr.cue similarity index 100% rename from tests/stdlib/aws/ecr/.dagger/env/default/plan/ecr.cue rename to stdlib/.dagger/env/aws-ecr/plan/ecr.cue diff --git a/tests/stdlib/aws/ecr/.dagger/env/default/values.yaml b/stdlib/.dagger/env/aws-ecr/values.yaml similarity index 76% rename from tests/stdlib/aws/ecr/.dagger/env/default/values.yaml rename to stdlib/.dagger/env/aws-ecr/values.yaml index b8dcf96d..dab0f763 100644 --- a/tests/stdlib/aws/ecr/.dagger/env/default/values.yaml +++ b/stdlib/.dagger/env/aws-ecr/values.yaml @@ -1,4 +1,4 @@ -name: default +name: aws-ecr inputs: TestConfig.awsConfig.accessKey: secret: ENC[AES256_GCM,data:iu6LfQNgGZUVnHVeMRYPrcBtlZk=,iv:U5PLxDKXwJnUDdk1ayFGvvJfWdVqh1PK5ujb20YYPP0=,tag:QyqIJRiR6nE16ZDV0CP7Pw==,type:str] @@ -19,8 +19,8 @@ sops: aXlvVWJVSGNTSkVyYmpZbi9nUVJZdmMK6csXZ2RMxFw5DB+Hb2TyhyoZT8c2/z7Y Lc9Pe8gb8aUq5Ha+wCybYvY6JWEM5A9XYJKbE7f4borTfGKS72d6pw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-05-27T00:53:54Z" - mac: ENC[AES256_GCM,data:ho/e/xUzRdwwe3VRCz9p8UNHgxdhAxkNtWUJLS5fEXBGnw28hjwNBbPYN78bX0k9SQ/5bgvXT2O/Z+zmOSWfrCYD2eojh9mDR4aCV5m/liVh5Dxha65u6zPl9VVcSunYg3wqe9Zl+pMG8BJXvczQS7S5QEGEaWojfaA/o7HM1BE=,iv:o/cVw6GBCCdgIqIZGDzqSCiBHUmrhAoIRcyGS9P83j0=,tag:WSQO0C0lPH2vOzl07rmRGg==,type:str] + lastmodified: "2021-06-09T18:52:22Z" + mac: ENC[AES256_GCM,data:p0lsZ+NEE5lvUef2uMIWlkoHOx+ur6YKwPdR8vI5vrjp+zRRGPQXfeOtfbScmMvOJj6OM1v1Gitlq+UVPWekOiuPaIoG1lWdNCZoq8+5Jf9sCFFUK0Fl8C2dAUIp6/84odwHhMB/jWR58rsqdvM4VilFMM6xnSENvXZn7fxzOng=,iv:jP2OXQYAYmb+rOpclUPpPX3phwSmpNJF3x1xDZdZOCI=,tag:/ZMA7kCCF9cRPSsh8u8iqw==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/tests/stdlib/aws/s3/.dagger/env/default/.gitignore b/stdlib/.dagger/env/aws-s3/.gitignore similarity index 100% rename from tests/stdlib/aws/s3/.dagger/env/default/.gitignore rename to stdlib/.dagger/env/aws-s3/.gitignore diff --git a/tests/stdlib/aws/s3/.dagger/env/default/plan/s3.cue b/stdlib/.dagger/env/aws-s3/plan/s3.cue similarity index 100% rename from tests/stdlib/aws/s3/.dagger/env/default/plan/s3.cue rename to stdlib/.dagger/env/aws-s3/plan/s3.cue diff --git a/tests/stdlib/aws/s3/.dagger/env/default/plan/verify.cue b/stdlib/.dagger/env/aws-s3/plan/verify.cue similarity index 100% rename from tests/stdlib/aws/s3/.dagger/env/default/plan/verify.cue rename to stdlib/.dagger/env/aws-s3/plan/verify.cue diff --git a/tests/stdlib/aws/s3/.dagger/env/default/values.yaml b/stdlib/.dagger/env/aws-s3/values.yaml similarity index 74% rename from tests/stdlib/aws/s3/.dagger/env/default/values.yaml rename to stdlib/.dagger/env/aws-s3/values.yaml index dbf764c7..87da3ae7 100644 --- a/tests/stdlib/aws/s3/.dagger/env/default/values.yaml +++ b/stdlib/.dagger/env/aws-s3/values.yaml @@ -1,4 +1,4 @@ -name: default +name: aws-s3 inputs: TestConfig.awsConfig.accessKey: secret: ENC[AES256_GCM,data:iu6LfQNgGZUVnHVeMRYPrcBtlZk=,iv:U5PLxDKXwJnUDdk1ayFGvvJfWdVqh1PK5ujb20YYPP0=,tag:QyqIJRiR6nE16ZDV0CP7Pw==,type:str] @@ -6,8 +6,7 @@ inputs: secret: ENC[AES256_GCM,data:Q/W+KH3NEouGt6C5S+KiC43837soYi2Mjb/z5K8rD9gtaNaBjjkJHg==,iv:8nGEzLXd91rF5YBZ/EdQoMN27yrpc0sgm26DEvIuSHM=,tag:/oyKl/vj5MJAm+jZMOOAuQ==,type:str] TestDirectory: dir: - path: ./testdata - include: [] + path: ./aws/s3/testdata sops: kms: [] gcp_kms: [] @@ -23,8 +22,8 @@ sops: aXlvVWJVSGNTSkVyYmpZbi9nUVJZdmMK6csXZ2RMxFw5DB+Hb2TyhyoZT8c2/z7Y Lc9Pe8gb8aUq5Ha+wCybYvY6JWEM5A9XYJKbE7f4borTfGKS72d6pw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-05-27T00:13:13Z" - mac: ENC[AES256_GCM,data:uqGhc0e6mQp5kdKvJTFz+yjcc5WUtLBcsqkzh0NeJhP9nztpX1TJfqBeyGfd7pwltL6b9YXLdJx/myCMxvJ6O8bS726AxE4ogcRgUGP6d5Q5aXw9i7VkLgVKY+gJZCbT+r80RiMqm23x3CPAPNjEsPh5nfgdNsN5ltJmq7IUGj0=,iv:Mw56hEghRGw6tLP6rhe78yD/blqgX2roeQRDiJ6+kAI=,tag:qE2LtSZPxDhITtdnsvrYfA==,type:str] + lastmodified: "2021-06-09T19:30:57Z" + mac: ENC[AES256_GCM,data:kIT54J5QImmFYIgQvj6kDkWLa+7kWNN5yhN+A+2qwofJsLdbIrPrihd59mi+RPlRgO0gzePEqEsGfoNpQBMvfXZDAPDiHAv0xKiGLnkQLX1N9PxoSNvORzqk3SAHJPlfVIbVAmGEp4Oy09I0Qi43xvvISsYXtlsiMp0Zm/QfYFY=,iv:l902awO6UvpJIPogIKeOfsMgGL2Ivp4KFQ/1jef/+kU=,tag:yP0oPIwfReNU4gCIeUTwaQ==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/tests/stdlib/docker/run/local/.dagger/env/default/.gitignore b/stdlib/.dagger/env/docker-run-local/.gitignore similarity index 100% rename from tests/stdlib/docker/run/local/.dagger/env/default/.gitignore rename to stdlib/.dagger/env/docker-run-local/.gitignore diff --git a/stdlib/.dagger/env/docker-run-local/plan/local.cue b/stdlib/.dagger/env/docker-run-local/plan/local.cue new file mode 100644 index 00000000..2c3505f4 --- /dev/null +++ b/stdlib/.dagger/env/docker-run-local/plan/local.cue @@ -0,0 +1,15 @@ +package main + +import ( + "dagger.io/docker" + "dagger.io/random" +) + +suffix: random.#String & { + seed: "" +} + +run: docker.#Run & { + name: "daggerci-test-local-\(suffix.out)" + ref: "hello-world" +} diff --git a/tests/stdlib/docker/run/local/.dagger/env/default/values.yaml b/stdlib/.dagger/env/docker-run-local/values.yaml similarity index 66% rename from tests/stdlib/docker/run/local/.dagger/env/default/values.yaml rename to stdlib/.dagger/env/docker-run-local/values.yaml index 8b1ff63c..0d832c06 100644 --- a/tests/stdlib/docker/run/local/.dagger/env/default/values.yaml +++ b/stdlib/.dagger/env/docker-run-local/values.yaml @@ -1,4 +1,4 @@ -name: default +name: docker-run-local sops: kms: [] gcp_kms: [] @@ -14,8 +14,8 @@ sops: cnh2eHU5TzFjVkNvTzUyczFBL0pwTDQK60+wrLmTaD3Ws5ZAXdqBkMjaVP7Iz69k UrkqkMbaUlvvSKK7dB5MuTGEEN6A1viAGal9ZjDHlSobkNPuE24QEA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-04T23:50:06Z" - mac: ENC[AES256_GCM,data:GTsG9ekL5O04qwUSBb4hqRgQIiXL7keLXLt0gWpwLe0KUTu/JojAt0ALTiU8m5QWGy2q/avKIql8xR3SWWuBahOsKeObFbnx6PbVpU5QvZZKA8c72m2C+fDE82eKT3qZoTbwBEY3A/7v9BsFSCgkg3Hb91zVnBlXjiD949YAgP4=,iv:sYDEUDjyYJCoJFRP7EG19PTZgPaGa98gASs2B4fMAtE=,tag:CL5hhRG16EvuLwhPq5bdKQ==,type:str] + lastmodified: "2021-06-09T19:32:39Z" + mac: ENC[AES256_GCM,data:Sm+KP6fL5SVpYxQ03978TAnMI4yqNHQomt2uQA23q+3YN+K7okVS7CM+By/K8Xn2Z3y26A4hFnRvMJTV/qpGQ4hz9+qWU5AOuQvJqtNvRgkf6yfFhF6nWS3vNIHbKdHHD8cBXWGvU+A/j/3YsjJL2GlLd1Tcee9WbmKKBKEDSpg=,iv:0pmOoiyZybpS4kdmjQaTueU5wrMMuDh1qMQrcI4yeXI=,tag:p3y0cMY0h1b/p35snTZ6rg==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/tests/stdlib/docker/run/ssh-passphrase/.dagger/env/default/.gitignore b/stdlib/.dagger/env/docker-run-ssh-passphrase/.gitignore similarity index 100% rename from tests/stdlib/docker/run/ssh-passphrase/.dagger/env/default/.gitignore rename to stdlib/.dagger/env/docker-run-ssh-passphrase/.gitignore diff --git a/tests/stdlib/docker/run/ssh-passphrase/.dagger/env/default/plan/passphrase.cue b/stdlib/.dagger/env/docker-run-ssh-passphrase/plan/passphrase.cue similarity index 100% rename from tests/stdlib/docker/run/ssh-passphrase/.dagger/env/default/plan/passphrase.cue rename to stdlib/.dagger/env/docker-run-ssh-passphrase/plan/passphrase.cue diff --git a/tests/stdlib/docker/run/ssh-passphrase/.dagger/env/default/values.yaml b/stdlib/.dagger/env/docker-run-ssh-passphrase/values.yaml similarity index 82% rename from tests/stdlib/docker/run/ssh-passphrase/.dagger/env/default/values.yaml rename to stdlib/.dagger/env/docker-run-ssh-passphrase/values.yaml index d9766199..e379697c 100644 --- a/tests/stdlib/docker/run/ssh-passphrase/.dagger/env/default/values.yaml +++ b/stdlib/.dagger/env/docker-run-ssh-passphrase/values.yaml @@ -1,4 +1,4 @@ -name: default +name: docker-run-ssh-passphrase inputs: TestConfig.host: text: 143.198.64.230 @@ -23,8 +23,8 @@ sops: ZXAwa1h2aEhGRGpwVTJzKy9EZGhQb0kKSYnRAiRh7b2LViajHk46ct94PVLHDajC oaUPwzy4bIMI9UXGobkstC5ObmY3ba+jcPRy6c9moniL+iigZ8YglA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-07T21:46:15Z" - mac: ENC[AES256_GCM,data:d+ZtEtXXoemDIuKPR1cVKjLHi4iKyfVz3hwwbvsCiAEqcbjVk19KMZIaxIM+LOL3Jm4O4Ud7Q+JKSLm1FBmUqrb+Q+hiYw67TPGZ7oS0nwUlJ5+JK/PMxWaYGCs4AdJ7wQjHguXX9Nx7td7oH4T47j+UpEKZluLrt8gZNwi8Qyo=,iv:qaTD/Q+cA+dVSsBcClkbWeNJo/3d+OumwKMLxFyQJAw=,tag:dcZ9RE+JUh04N8gMPdK3ZQ==,type:str] + lastmodified: "2021-06-09T20:14:54Z" + mac: ENC[AES256_GCM,data:ujrtYlsNtf58NNFjixESyUaqG4sM0Li6LjCCc16xhRMtepo7pdc85f8zqAU2II97EXW/DG0Cf9SKOejbRw7u+ZwtlssjFN//1BmbZzKTYE78KUNDfZjRAr1KQHjabug8iGpjmBpRs3UZ3gozQPoHPjRw7CZDzr+tV3mQ3N0qhUA=,iv:lJHb4UYnEc2T9jR24dRnCJ9/nmT5OY8jhrsc9LkhyNg=,tag:7F65O5IovHEaaFfomcS/6g==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/tests/stdlib/docker/run/ssh-wrong-passphrase/.dagger/env/default/.gitignore b/stdlib/.dagger/env/docker-run-ssh-wrong-passphrase/.gitignore similarity index 100% rename from tests/stdlib/docker/run/ssh-wrong-passphrase/.dagger/env/default/.gitignore rename to stdlib/.dagger/env/docker-run-ssh-wrong-passphrase/.gitignore diff --git a/tests/stdlib/docker/run/ssh-wrong-passphrase/.dagger/env/default/plan/wrong-passphrase.cue b/stdlib/.dagger/env/docker-run-ssh-wrong-passphrase/plan/wrong-passphrase.cue similarity index 100% rename from tests/stdlib/docker/run/ssh-wrong-passphrase/.dagger/env/default/plan/wrong-passphrase.cue rename to stdlib/.dagger/env/docker-run-ssh-wrong-passphrase/plan/wrong-passphrase.cue diff --git a/tests/stdlib/docker/run/ssh-wrong-passphrase/.dagger/env/default/values.yaml b/stdlib/.dagger/env/docker-run-ssh-wrong-passphrase/values.yaml similarity index 82% rename from tests/stdlib/docker/run/ssh-wrong-passphrase/.dagger/env/default/values.yaml rename to stdlib/.dagger/env/docker-run-ssh-wrong-passphrase/values.yaml index 8b27a51a..9cc3678b 100644 --- a/tests/stdlib/docker/run/ssh-wrong-passphrase/.dagger/env/default/values.yaml +++ b/stdlib/.dagger/env/docker-run-ssh-wrong-passphrase/values.yaml @@ -1,4 +1,4 @@ -name: default +name: docker-run-ssh-wrong-passphrase inputs: TestConfig,passphrase: secret: ENC[AES256_GCM,data:HdlbbaOogb6G,iv:Q0D3w/bEtijvaEK2ac9zmj817x7xZM2OspTmPDVBJDg=,tag:i0iGhuqMng2spumFWve18Q==,type:str] @@ -23,8 +23,8 @@ sops: cm02K1NEenRnL25zc3RtaXd6SlA0UXcKFq38uYqZWvSlTOaisnhnQ+Mhbcv+ZifE Mdxhq5w+Cdj+XhwbZ8UnnRInckD3UKovxAHV3kTSdXf54/QKn5TLVw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-07T21:46:27Z" - mac: ENC[AES256_GCM,data:ok+QLvbyYtznT2dqUdMQDq1mSsLA5UdMfo04lZRFcn5NYnqUejwP5VZBA7aqR9QRbWg9h5S6VfSHskBEJklcQ2pKdi1Rd8nGWnmqULfnfB6riJ+oAdKo//+nwOIMEN/cyufjoi1Ptr21mXopnwsTOFlkgLYYYrDcIlvKlMxPrY8=,iv:YdN2OZbE/oMavwQlJig6mzZwGrKLMS/eJjFb743E1nM=,tag:dg4iA5azDhYeVNCCpK2Rsw==,type:str] + lastmodified: "2021-06-09T20:15:05Z" + mac: ENC[AES256_GCM,data:+TLvTAkn2gMOxpcKhH0lvTBau/0xdgg/H9++2x0faYOA4CTLB6SzvUUvTGhrN0Z7Vut7suYPdOR4xHypfggJ6aiCmZ9PeXTwoO6F8ycAQ7TPFdBafHO61OV1fRb87X79hRU8SaKPIWrDF786lcHDGcMYkcoqyWsXDYloAEpL2t0=,iv:KYNpHruxv+l5LUqeYjXhF6cmblj70WSHlCZzlIRn7lo=,tag:ASxWqdkYtU9AyQ4aGyzL2w==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/tests/stdlib/docker/run/ssh/.dagger/env/default/.gitignore b/stdlib/.dagger/env/docker-run-ssh/.gitignore similarity index 100% rename from tests/stdlib/docker/run/ssh/.dagger/env/default/.gitignore rename to stdlib/.dagger/env/docker-run-ssh/.gitignore diff --git a/tests/stdlib/docker/run/ssh/.dagger/env/default/plan/simple.cue b/stdlib/.dagger/env/docker-run-ssh/plan/simple.cue similarity index 100% rename from tests/stdlib/docker/run/ssh/.dagger/env/default/plan/simple.cue rename to stdlib/.dagger/env/docker-run-ssh/plan/simple.cue diff --git a/tests/stdlib/docker/run/ssh/.dagger/env/default/values.yaml b/stdlib/.dagger/env/docker-run-ssh/values.yaml similarity index 81% rename from tests/stdlib/docker/run/ssh/.dagger/env/default/values.yaml rename to stdlib/.dagger/env/docker-run-ssh/values.yaml index 18e47d93..4f50d3b5 100644 --- a/tests/stdlib/docker/run/ssh/.dagger/env/default/values.yaml +++ b/stdlib/.dagger/env/docker-run-ssh/values.yaml @@ -1,4 +1,4 @@ -name: default +name: docker-run-ssh inputs: TestConfig.host: text: 143.198.64.230 @@ -21,8 +21,8 @@ sops: cnh2eHU5TzFjVkNvTzUyczFBL0pwTDQK60+wrLmTaD3Ws5ZAXdqBkMjaVP7Iz69k UrkqkMbaUlvvSKK7dB5MuTGEEN6A1viAGal9ZjDHlSobkNPuE24QEA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-06-07T21:46:00Z" - mac: ENC[AES256_GCM,data:hmw4ffQL+8lcDdevuJFy0lWD4ItISg2XxFCxNqaYhEOBneEkWQLJmrzX35yp3PoMvgDGLCFNFWamKEgU7WkXe9v4h19UmtOBJLRvj2USDguRBNUBMIiEyijwUbp+Eur28U7V3yWfeltCuBMw+woui9waQeG3PbDkoKUyBztuhS8=,iv:9vno6+T8SHeCiGIN+z95a8lKFaFzV0jimrAbsPQSmrc=,tag:uaN4MGeksUSCasaMyitFJQ==,type:str] + lastmodified: "2021-06-09T18:51:57Z" + mac: ENC[AES256_GCM,data:rhZJ4ZVvYJ/Btws52OrXHCZIRb9R3uRmX4+MFaro92PMJETJrCH07GL/UkPmqQPiQDDQC6sTW3/+U3d2KSrOtdBx5opqyl6oilj4DBmXiVVEGbYbUumbUaF4vFCY9iBhGUTIvt6Aw2ZDEm4lKWYor4/r34RU9Abymv4sMshHXBo=,iv:VwYk+kEtuhCzrwu8flV7Hb5l5dwZGtPuAFSgBw4UPb4=,tag:MZ6ovCv6WjgamPK1yCqxqQ==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/tests/stdlib/gcp/gcr/.dagger/env/default/.gitignore b/stdlib/.dagger/env/google-gcr/.gitignore similarity index 100% rename from tests/stdlib/gcp/gcr/.dagger/env/default/.gitignore rename to stdlib/.dagger/env/google-gcr/.gitignore diff --git a/tests/stdlib/gcp/gcr/.dagger/env/default/plan/gcr.cue b/stdlib/.dagger/env/google-gcr/plan/gcr.cue similarity index 100% rename from tests/stdlib/gcp/gcr/.dagger/env/default/plan/gcr.cue rename to stdlib/.dagger/env/google-gcr/plan/gcr.cue diff --git a/tests/stdlib/gcp/gcr/.dagger/env/default/values.yaml b/stdlib/.dagger/env/google-gcr/values.yaml similarity index 92% rename from tests/stdlib/gcp/gcr/.dagger/env/default/values.yaml rename to stdlib/.dagger/env/google-gcr/values.yaml index bff70a40..9ffdfc79 100644 --- a/tests/stdlib/gcp/gcr/.dagger/env/default/values.yaml +++ b/stdlib/.dagger/env/google-gcr/values.yaml @@ -1,4 +1,4 @@ -name: default +name: google-gcr inputs: TestConfig.gcpConfig.project: text: dagger-ci @@ -21,8 +21,8 @@ sops: ZXd6Qmd1YUtxMnVTVkYybWgrV3pVK2MKowMeOZU3j3BxERT0DwhQYCGUDBK6gCdo WByubiBATdsb7h7ytCC4HutWppynK4MpU+Ya9NP83AZuXo+Wa2u6aQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-05-28T02:07:09Z" - mac: ENC[AES256_GCM,data:QqbgWep3l7dIfE4imJ3SKsMdexh7DgUvjtGwSgKbHHnT0p2MwIdFMY7pB0ZJvlc3ZwQyioT3wqF9xgn4U60a4piGtDYsyWjZn52tQAPy0p9c+sOHn+WlFVu1FJeljU4Q3mlEqdA6g993nsbJp9RnNShpc65rQXUMLkw2lXhOAak=,iv:1pp1D1fUFGI+Kn/H2efaqroJV+rzJRGmWo2ZTseTDis=,tag:ePCkD/G2KEbN7cxiMpy9fg==,type:str] + lastmodified: "2021-06-09T18:33:30Z" + mac: ENC[AES256_GCM,data:u5StrL3GZimbfFDXhPeSCs+pvZqiM3CNSslySZY4MES2PldNSizJ7XU/75WhHJ+hBuNjVuIq37OPD3/N2KKuj8+R7FufPFIj/S2uwaAgWn3dfWBipRASubWGK8IC+Ab1tE53lUZYL+f55oUDG9Qoofpoo6d6bghU0bwIDI7qw8M=,iv:Zx+dBTW+ykbDYvQDMZEd6VWVqVGhRET2HAPSWW+bmTU=,tag:a6v5v0Vhv0Z//EThKJrktw==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/tests/stdlib/gcp/gke/.dagger/env/default/.gitignore b/stdlib/.dagger/env/google-gke/.gitignore similarity index 100% rename from tests/stdlib/gcp/gke/.dagger/env/default/.gitignore rename to stdlib/.dagger/env/google-gke/.gitignore diff --git a/tests/stdlib/gcp/gke/.dagger/env/default/plan/gke.cue b/stdlib/.dagger/env/google-gke/plan/gke.cue similarity index 100% rename from tests/stdlib/gcp/gke/.dagger/env/default/plan/gke.cue rename to stdlib/.dagger/env/google-gke/plan/gke.cue diff --git a/tests/stdlib/gcp/gke/.dagger/env/default/values.yaml b/stdlib/.dagger/env/google-gke/values.yaml similarity index 92% rename from tests/stdlib/gcp/gke/.dagger/env/default/values.yaml rename to stdlib/.dagger/env/google-gke/values.yaml index bff70a40..c4d49f8e 100644 --- a/tests/stdlib/gcp/gke/.dagger/env/default/values.yaml +++ b/stdlib/.dagger/env/google-gke/values.yaml @@ -1,4 +1,4 @@ -name: default +name: google-gke inputs: TestConfig.gcpConfig.project: text: dagger-ci @@ -21,8 +21,8 @@ sops: ZXd6Qmd1YUtxMnVTVkYybWgrV3pVK2MKowMeOZU3j3BxERT0DwhQYCGUDBK6gCdo WByubiBATdsb7h7ytCC4HutWppynK4MpU+Ya9NP83AZuXo+Wa2u6aQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-05-28T02:07:09Z" - mac: ENC[AES256_GCM,data:QqbgWep3l7dIfE4imJ3SKsMdexh7DgUvjtGwSgKbHHnT0p2MwIdFMY7pB0ZJvlc3ZwQyioT3wqF9xgn4U60a4piGtDYsyWjZn52tQAPy0p9c+sOHn+WlFVu1FJeljU4Q3mlEqdA6g993nsbJp9RnNShpc65rQXUMLkw2lXhOAak=,iv:1pp1D1fUFGI+Kn/H2efaqroJV+rzJRGmWo2ZTseTDis=,tag:ePCkD/G2KEbN7cxiMpy9fg==,type:str] + lastmodified: "2021-06-09T18:53:49Z" + mac: ENC[AES256_GCM,data:hKBqKd8ZoEPiU9+B3Ccjs0ionnPJYaJIKwtJnoQjE1YqxrpHFICyoHre80/PeEO3tXCZuyw0BpA3hICTua4o+VfawKUf3jjWJNog7HtTmUHFl4YZd0r3FoqjCiTF/Bf617DGTn6HozjpQbn3zS6JFGTa2vleZi9islyzxtqmjw8=,iv:b0BKP3UZ1hUSJvMKBpXhKR3lOj5sieTAy7QQzrkCSOU=,tag:so+0De5l6Quqp4f9Le+aPA==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/tests/stdlib/netlify/.dagger/env/default/.gitignore b/stdlib/.dagger/env/netlify/.gitignore similarity index 100% rename from tests/stdlib/netlify/.dagger/env/default/.gitignore rename to stdlib/.dagger/env/netlify/.gitignore diff --git a/tests/stdlib/netlify/.dagger/env/default/plan/netlify.cue b/stdlib/.dagger/env/netlify/plan/netlify.cue similarity index 100% rename from tests/stdlib/netlify/.dagger/env/default/plan/netlify.cue rename to stdlib/.dagger/env/netlify/plan/netlify.cue diff --git a/tests/stdlib/netlify/.dagger/env/default/values.yaml b/stdlib/.dagger/env/netlify/values.yaml similarity index 74% rename from tests/stdlib/netlify/.dagger/env/default/values.yaml rename to stdlib/.dagger/env/netlify/values.yaml index 75cb6fc7..4c4f19c0 100644 --- a/tests/stdlib/netlify/.dagger/env/default/values.yaml +++ b/stdlib/.dagger/env/netlify/values.yaml @@ -1,4 +1,4 @@ -name: default +name: netlify inputs: TestNetlify.deploy.account.name: text: blocklayer @@ -19,8 +19,8 @@ sops: SEdUK2RsaUxuVWg2aXUwdVJ0eUtrWWMKWkQDBuL5e4QDx5Wy6+fHiD+J4fp7QdMm lsqgmxRvJMWgEvm1U+hDAo/Pkn8PFUFJf0KxEvkdF4qGuguQePgzFQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2021-05-28T20:40:41Z" - mac: ENC[AES256_GCM,data:12suvaaHfmdt0jaldFmaixGvWUbl0RP/By3l1S9XiUGLbB4tNfV65qsWv9BnjfD//98iV21dYkpCbXPQAITjM0MOGcrkZ9u3lDrmD2dTybHgxgniYJVe/X7BA5Y8uw4a3g+k+HqV5Z8i/iMGCEBbqakt20rNXqzGAFiWJfRcPGo=,iv:6TdOLjFJxn1uDsCLRNGpyUSiLszKHctN0crywXB5PfQ=,tag:XGcPX6lGeJcigxvOuiqyyw==,type:str] + lastmodified: "2021-06-09T18:53:39Z" + mac: ENC[AES256_GCM,data:m2TA71YjNpiGlBH1nEKcbKDCOBS8x8ia2d+g43+f+LprnhAqav2GlgYaU5XU4n/M6SGtxE9NskfaOZ6z8tcBH01UvFatRX2jvpiVdcUuy/ULyb5ygK1D0g4Ok60nxD+Wp1JIbbIktevv6C4jGA0+TC6g8JjSinD5yXx9uzSDrKY=,iv:081twRYPy26JoGZL0TlknF7ktcG5eNzIPtvNK6Mzt2E=,tag:npnDVRON2N6LlWCsf1vAxA==,type:str] pgp: [] encrypted_suffix: secret version: 3.7.1 diff --git a/stdlib/.gitignore b/stdlib/.gitignore new file mode 100644 index 00000000..ff8f4176 --- /dev/null +++ b/stdlib/.gitignore @@ -0,0 +1,2 @@ +node_modules +report.xml diff --git a/tests/stdlib/aws/s3/testdata/bar/foo.txt b/stdlib/aws/s3/testdata/bar/foo.txt similarity index 100% rename from tests/stdlib/aws/s3/testdata/bar/foo.txt rename to stdlib/aws/s3/testdata/bar/foo.txt diff --git a/tests/stdlib/aws/s3/testdata/dirFile.txt b/stdlib/aws/s3/testdata/dirFile.txt similarity index 100% rename from tests/stdlib/aws/s3/testdata/dirFile.txt rename to stdlib/aws/s3/testdata/dirFile.txt diff --git a/stdlib/package.json b/stdlib/package.json new file mode 100644 index 00000000..21469ef1 --- /dev/null +++ b/stdlib/package.json @@ -0,0 +1,11 @@ +{ + "license": "Apache-2.0", + "scripts": { + "test": "bats --report-formatter junit --jobs 4 ." + }, + "devDependencies": { + "bats": "https://github.com/bats-core/bats-core#master", + "bats-assert": "https://github.com/bats-core/bats-assert", + "bats-support": "https://github.com/bats-core/bats-support" + } +} diff --git a/stdlib/universe.bats b/stdlib/universe.bats new file mode 100644 index 00000000..2d0bf9d2 --- /dev/null +++ b/stdlib/universe.bats @@ -0,0 +1,45 @@ + +setup() { + load 'node_modules/bats-assert/load' +} + +function dagger() { + "${DAGGER_BINARY:-$(which dagger)}" "$@" +} + +@test "netlify" { + dagger -e netlify up +} + +@test "aws: ecr" { + dagger -e aws-ecr up +} + +@test "aws: s3" { + dagger -e aws-s3 up +} + +@test "docker run: local" { + dagger -e docker-run-local up +} + +@test "docker run: ssh" { + dagger -e docker-run-ssh up +} + +@test "docker run: ssh with passphrase" { + dagger -e docker-run-ssh-passphrase up +} + +@test "docker run: ssh with wrong passphrase" { + run dagger -e docker-run-ssh-wrong-passphrase up + assert_failure +} + +@test "google cloud: gcr" { + dagger -e google-gcr up +} + +@test "google cloud: gke" { + dagger -e google-gke up +} diff --git a/stdlib/yarn.lock b/stdlib/yarn.lock new file mode 100644 index 00000000..7638a66e --- /dev/null +++ b/stdlib/yarn.lock @@ -0,0 +1,15 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"bats-assert@https://github.com/bats-core/bats-assert": + version "2.0.0" + resolved "https://github.com/bats-core/bats-assert#e0de84e9c011223e7f88b7ccf1c929f4327097ba" + +"bats-support@https://github.com/bats-core/bats-support": + version "0.3.0" + resolved "https://github.com/bats-core/bats-support#d140a65044b2d6810381935ae7f0c94c7023c8c3" + +"bats@https://github.com/bats-core/bats-core#master": + version "1.3.0" + resolved "https://github.com/bats-core/bats-core#ce5ca2802fabe5dc38393240cd40e20f8928d3b0" diff --git a/tests/stdlib.bats b/tests/stdlib.bats index dae09ba4..e79128dc 100644 --- a/tests/stdlib.bats +++ b/tests/stdlib.bats @@ -20,10 +20,6 @@ setup() { "$DAGGER" compute "$TESTDIR"/stdlib/file } -@test "stdlib: netlify" { - "$DAGGER" up -w "$TESTDIR"/stdlib/netlify/ -} - @test "stdlib: kubernetes" { skip_unless_local_kube @@ -59,26 +55,6 @@ setup() { assert_success } -@test "stdlib: aws: s3" { - "$DAGGER" up -w "$TESTDIR"/stdlib/aws/s3 -} - -@test "stdlib: aws: eks" { - "$DAGGER" up -w "$TESTDIR"/stdlib/aws/eks -} - -@test "stdlib: aws: ecr" { - "$DAGGER" up -w "$TESTDIR"/stdlib/aws/ecr -} - -@test "stdlib: gcp: gke" { - "$DAGGER" up -w "$TESTDIR"/stdlib/gcp/gke -} - -@test "stdlib: gcp: gcr" { - "$DAGGER" up -w "$TESTDIR"/stdlib/gcp/gcr -} - @test "stdlib: docker: build" { "$DAGGER" compute "$TESTDIR"/stdlib/docker/build/ --input-dir source="$TESTDIR"/stdlib/docker/build } @@ -95,25 +71,6 @@ setup() { assert_success } -@test "stdlib: docker: run" { - # FIXME: local run disabled - # Local run - # run "$DAGGER" up -w "$TESTDIR"/stdlib/docker/run/local/ - # assert_success - - # SSH key - run "$DAGGER" up -w "$TESTDIR"/stdlib/docker/run/ssh/ - assert_success - - # SSH passphrase - run "$DAGGER" up -w "$TESTDIR"/stdlib/docker/run/ssh-passphrase/ - assert_success - - # Wrong passphrase - run "$DAGGER" up -w "$TESTDIR"/stdlib/docker/run/ssh-wrong-passphrase/ - assert_failure -} - @test "stdlib: terraform" { skip_unless_secrets_available "$TESTDIR"/stdlib/terraform/s3/inputs.yaml diff --git a/tests/stdlib/docker/run/local/.dagger/env/default/plan/local.cue b/tests/stdlib/docker/run/local/.dagger/env/default/plan/local.cue deleted file mode 100644 index 1862365f..00000000 --- a/tests/stdlib/docker/run/local/.dagger/env/default/plan/local.cue +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "dagger.io/docker" - "dagger.io/dagger" - "dagger.io/random" -) - -TestRun: { - suffix: random.#String & { - seed: "" - } - - run: docker.#Run & { - name: "daggerci-test-local-\(suffix.out)" - ref: "hello-world" - } -}