Merge pull request #350 from TomChv/tests-aws-eks
This commit is contained in:
commit
7bcd28582f
@ -1,7 +1,6 @@
|
|||||||
package eks
|
package eks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
|
||||||
"dagger.io/dagger/op"
|
"dagger.io/dagger/op"
|
||||||
"dagger.io/aws"
|
"dagger.io/aws"
|
||||||
)
|
)
|
||||||
@ -19,16 +18,19 @@ import (
|
|||||||
|
|
||||||
// kubeconfig is the generated kube configuration file
|
// kubeconfig is the generated kube configuration file
|
||||||
kubeconfig: {
|
kubeconfig: {
|
||||||
dagger.#Secret
|
// FIXME There is a problem with dagger.#Secret type
|
||||||
|
string
|
||||||
|
|
||||||
#up: [
|
#up: [
|
||||||
op.#Load & {
|
op.#Load & {
|
||||||
from: aws.#CLI
|
from: aws.#CLI
|
||||||
},
|
},
|
||||||
|
|
||||||
op.#WriteFile & {
|
op.#WriteFile & {
|
||||||
dest: "/entrypoint.sh"
|
dest: "/entrypoint.sh"
|
||||||
content: #Code
|
content: #Code
|
||||||
},
|
},
|
||||||
|
|
||||||
op.#Exec & {
|
op.#Exec & {
|
||||||
always: true
|
always: true
|
||||||
args: [
|
args: [
|
||||||
|
@ -42,4 +42,9 @@ setup() {
|
|||||||
skip_unless_secrets_available "$TESTDIR"/stdlib/aws/inputs.yaml
|
skip_unless_secrets_available "$TESTDIR"/stdlib/aws/inputs.yaml
|
||||||
|
|
||||||
"$DAGGER" compute "$TESTDIR"/stdlib/aws/s3 --input-dir TestDirectory="$TESTDIR"/stdlib/aws/s3/testdata --input-yaml "$TESTDIR"/stdlib/aws/inputs.yaml
|
"$DAGGER" compute "$TESTDIR"/stdlib/aws/s3 --input-dir TestDirectory="$TESTDIR"/stdlib/aws/s3/testdata --input-yaml "$TESTDIR"/stdlib/aws/inputs.yaml
|
||||||
|
}
|
||||||
|
@test "stdlib: aws" {
|
||||||
|
skip_unless_secrets_available "$TESTDIR"/stdlib/aws/inputs.yaml
|
||||||
|
|
||||||
|
"$DAGGER" compute "$TESTDIR"/stdlib/aws/eks --input-yaml "$TESTDIR"/stdlib/aws/inputs.yaml
|
||||||
}
|
}
|
53
tests/stdlib/aws/eks/eks.cue
Normal file
53
tests/stdlib/aws/eks/eks.cue
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
package eks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"dagger.io/aws"
|
||||||
|
"dagger.io/aws/eks"
|
||||||
|
"dagger.io/kubernetes"
|
||||||
|
"dagger.io/dagger/op"
|
||||||
|
)
|
||||||
|
|
||||||
|
TestConfig: awsConfig: aws.#Config & {
|
||||||
|
region: "us-east-2"
|
||||||
|
}
|
||||||
|
|
||||||
|
TestCluster: eks.#KubeConfig & {
|
||||||
|
config: TestConfig.awsConfig
|
||||||
|
clusterName: *"dagger-example-eks-cluster" | string
|
||||||
|
}
|
||||||
|
|
||||||
|
TestEks: {
|
||||||
|
#GetPods:
|
||||||
|
"""
|
||||||
|
kubectl get pods -A
|
||||||
|
"""
|
||||||
|
|
||||||
|
#up: [
|
||||||
|
op.#Load & {
|
||||||
|
from: kubernetes.#Kubectl
|
||||||
|
},
|
||||||
|
|
||||||
|
op.#WriteFile & {
|
||||||
|
dest: "/kubeconfig"
|
||||||
|
content: TestCluster.kubeconfig
|
||||||
|
},
|
||||||
|
|
||||||
|
op.#WriteFile & {
|
||||||
|
dest: "/getPods.sh"
|
||||||
|
content: #GetPods
|
||||||
|
},
|
||||||
|
|
||||||
|
op.#Exec & {
|
||||||
|
always: true
|
||||||
|
args: [
|
||||||
|
"/bin/bash",
|
||||||
|
"--noprofile",
|
||||||
|
"--norc",
|
||||||
|
"-eo",
|
||||||
|
"pipefail",
|
||||||
|
"/getPods.sh",
|
||||||
|
]
|
||||||
|
env: KUBECONFIG: "/kubeconfig"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
Reference in New Issue
Block a user