2021-06-09 21:08:03 +02:00
|
|
|
setup() {
|
2021-06-10 00:44:58 +02:00
|
|
|
load 'helpers'
|
2021-06-09 21:08:03 +02:00
|
|
|
|
2021-06-10 00:44:58 +02:00
|
|
|
common_setup
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
2021-06-23 16:31:42 +02:00
|
|
|
@test "cue-sanity-check" {
|
|
|
|
dagger -e sanity-check up
|
|
|
|
}
|
|
|
|
|
2021-06-09 20:37:05 +02:00
|
|
|
@test "os" {
|
|
|
|
dagger -e os up
|
|
|
|
}
|
|
|
|
|
2021-06-17 15:20:47 +02:00
|
|
|
@test "go" {
|
|
|
|
dagger -e go up
|
|
|
|
}
|
|
|
|
|
2021-06-10 12:50:49 +02:00
|
|
|
@test "js/yarn" {
|
|
|
|
dagger -e js-yarn up
|
|
|
|
}
|
|
|
|
|
2021-06-29 12:11:57 +02:00
|
|
|
@test "java/maven" {
|
|
|
|
dagger -e java-maven up
|
|
|
|
}
|
|
|
|
|
2021-06-10 12:29:49 +02:00
|
|
|
@test "alpine" {
|
|
|
|
dagger -e alpine up
|
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "netlify" {
|
|
|
|
dagger -e netlify up
|
|
|
|
}
|
|
|
|
|
2021-06-16 10:00:01 +02:00
|
|
|
@test "git" {
|
|
|
|
dagger -e git up
|
|
|
|
}
|
|
|
|
|
2021-06-23 12:46:56 +02:00
|
|
|
@test "os.#Container" {
|
|
|
|
dagger -e os-container up
|
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "aws: ecr" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e aws-ecr up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
2021-08-18 15:09:28 +02:00
|
|
|
@test "aws: ecr/localstack" {
|
2021-08-30 23:03:04 +02:00
|
|
|
skip "disabled because of inifinit loop"
|
|
|
|
# skip_unless_local_localstack
|
2021-08-18 15:09:28 +02:00
|
|
|
|
2021-08-30 23:03:04 +02:00
|
|
|
# dagger -e aws-ecr-localstack up
|
2021-08-18 15:09:28 +02:00
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "aws: s3" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e aws-s3 up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
2021-08-18 15:09:28 +02:00
|
|
|
@test "aws: s3/localstack" {
|
2021-08-30 23:03:04 +02:00
|
|
|
skip "disabled because of inifinit loop"
|
|
|
|
# skip_unless_local_localstack
|
2021-08-18 15:09:28 +02:00
|
|
|
|
2021-08-30 23:03:04 +02:00
|
|
|
# dagger -e aws-s3-localstack up
|
2021-08-18 15:09:28 +02:00
|
|
|
}
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
@test "aws: eks" {
|
|
|
|
dagger -e aws-eks up
|
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "docker run: local" {
|
2021-06-28 19:56:21 +02:00
|
|
|
skip "Not implemented yet + missing inputs leading to failure"
|
|
|
|
# dagger -e docker-run-local up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
@test "docker build" {
|
|
|
|
dagger -e docker-build up
|
|
|
|
}
|
|
|
|
|
2021-06-12 17:11:27 +02:00
|
|
|
@test "docker push and pull" {
|
|
|
|
# Push image
|
|
|
|
dagger -e docker-push up
|
|
|
|
|
|
|
|
# Get image reference
|
2021-06-12 17:11:41 +02:00
|
|
|
dagger -e docker-pull input text ref "$(dagger -e docker-push query -c TestPush.push.ref | tr -d '\n' | tr -d '\"')"
|
2021-06-12 17:11:27 +02:00
|
|
|
|
|
|
|
# Pull image
|
|
|
|
dagger -e docker-pull up
|
|
|
|
}
|
|
|
|
|
2021-07-01 15:48:03 +02:00
|
|
|
@test "docker push: multi registry" {
|
2021-07-01 17:49:05 +02:00
|
|
|
run dagger -e docker-push-multi-registry up
|
2021-07-01 15:48:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "docker push: invalid credential" {
|
2021-06-12 17:11:27 +02:00
|
|
|
# Push image (SHOULD FAIL)
|
2021-06-12 17:11:41 +02:00
|
|
|
run dagger -e docker-push-invalid-creds up
|
2021-06-12 17:11:27 +02:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2021-06-11 09:53:14 +02:00
|
|
|
@test "docker command: ssh" {
|
2021-06-11 19:01:33 +02:00
|
|
|
dagger -e docker-command-ssh up
|
2021-06-11 09:53:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "docker command: ssh with key passphrase" {
|
2021-06-11 19:01:33 +02:00
|
|
|
dagger -e docker-command-ssh-key-passphrase up
|
2021-06-11 09:53:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "docker command: ssh with wrong key passphrase" {
|
2021-06-11 19:01:33 +02:00
|
|
|
run dagger -e docker-command-ssh-wrong-key-passphrase up
|
|
|
|
assert_failure
|
2021-06-11 09:53:14 +02:00
|
|
|
}
|
|
|
|
|
2021-06-25 15:40:49 +02:00
|
|
|
@test "docker compose" {
|
|
|
|
dagger -e docker-compose up
|
2021-06-17 17:12:51 +02:00
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "docker run: ssh" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e docker-run-ssh up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
@test "kubernetes: deployment" {
|
|
|
|
skip_unless_local_kube
|
|
|
|
|
2021-06-18 19:15:48 +02:00
|
|
|
# Copy deployment to sandbox
|
2021-06-24 21:01:17 +02:00
|
|
|
copy_to_sandbox kubernetes-deployment kubernetes
|
2021-06-18 19:15:48 +02:00
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
# Set kubeconfig
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-deployment input text TestKubeconfig -f "$HOME"/.kube/config
|
2021-06-18 18:03:59 +02:00
|
|
|
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-deployment up
|
2021-06-18 18:03:59 +02:00
|
|
|
|
|
|
|
# Unset kubeconfig
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-deployment input unset TestKubeconfig
|
2021-06-18 18:03:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "kubernetes: kustomize" {
|
|
|
|
dagger -e kubernetes-kustomize up
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "kubernetes: helm" {
|
|
|
|
skip_unless_local_kube
|
|
|
|
|
2021-06-18 19:15:48 +02:00
|
|
|
# Copy deployment to sandbox
|
|
|
|
copy_to_sandbox kubernetes-helm kubernetes
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
# Set kubeconfig
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-helm input text TestKubeconfig -f "$HOME"/.kube/config
|
2021-06-18 18:03:59 +02:00
|
|
|
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-helm up
|
2021-06-18 18:03:59 +02:00
|
|
|
|
|
|
|
# Unset kubeconfig
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-helm input unset TestKubeconfig
|
2021-06-18 18:03:59 +02:00
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "google cloud: gcr" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e google-gcr up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
2021-06-30 12:18:21 +02:00
|
|
|
@test "google cloud: gcs" {
|
|
|
|
dagger -e google-gcs up
|
|
|
|
}
|
2021-06-30 06:31:23 +02:00
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "google cloud: gke" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e google-gke up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
2021-06-21 11:26:54 +02:00
|
|
|
|
|
|
|
@test "google cloud: cloudrun" {
|
|
|
|
dagger -e google-cloudrun up
|
|
|
|
}
|
2021-06-22 12:30:48 +02:00
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
@test "terraform" {
|
|
|
|
# it must fail because of a missing var
|
|
|
|
run dagger -e terraform up
|
|
|
|
assert_failure
|
|
|
|
|
2021-06-18 19:15:48 +02:00
|
|
|
# Copy deployment to sandbox
|
|
|
|
copy_to_sandbox terraform terraform
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
# Add the var and try again
|
2021-06-18 19:15:48 +02:00
|
|
|
run dagger -w "$DAGGER_SANDBOX" -e terraform input text TestTerraform.apply.tfvars.input "42"
|
|
|
|
run dagger -w "$DAGGER_SANDBOX" -e terraform up
|
2021-06-18 18:03:59 +02:00
|
|
|
assert_success
|
|
|
|
|
|
|
|
# ensure the tfvar was passed correctly
|
2021-06-18 19:15:48 +02:00
|
|
|
run dagger -w "$DAGGER_SANDBOX" query -e terraform TestTerraform.apply.output.input.value -f text
|
2021-06-18 18:03:59 +02:00
|
|
|
assert_success
|
|
|
|
assert_output "42"
|
|
|
|
|
|
|
|
# ensure the random value is always the same
|
|
|
|
# this proves we're effectively using the s3 backend
|
2021-06-18 19:15:48 +02:00
|
|
|
run dagger -w "$DAGGER_SANDBOX" query -e terraform TestTerraform.apply.output.random.value -f json
|
2021-06-18 18:03:59 +02:00
|
|
|
assert_success
|
|
|
|
assert_output "36"
|
|
|
|
|
|
|
|
# Unset input
|
2021-06-18 19:15:48 +02:00
|
|
|
run dagger -w "$DAGGER_SANDBOX" -e terraform input unset TestTerraform.apply.tfvars.input
|
2021-06-18 18:03:59 +02:00
|
|
|
assert_success
|
2021-06-22 12:30:48 +02:00
|
|
|
}
|
2021-08-10 19:20:16 +02:00
|
|
|
|
2021-08-11 15:16:56 +02:00
|
|
|
@test "azure-resourcegroup" {
|
|
|
|
skip "Azure CI infra not implemented yet - manually tested and working"
|
|
|
|
#dagger -e azure-resourcegroup up
|
2021-08-17 11:23:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "azure-storage" {
|
|
|
|
skip "Azure CI infra not implemented yet - manually tested and working"
|
|
|
|
#dagger -e azure-storage up
|
2021-08-30 23:03:04 +02:00
|
|
|
}
|