Move tests plan from dagger dir to universe

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2021-06-24 21:01:17 +02:00
parent 36cf20ae2d
commit c99e39ec9c
69 changed files with 215 additions and 166 deletions

33
stdlib/go/tests/go.cue Normal file
View File

@@ -0,0 +1,33 @@
package go
import (
"dagger.io/dagger"
"dagger.io/alpine"
"dagger.io/dagger/op"
)
TestData: dagger.#Artifact @dagger(input)
TestGoBuild: {
build: #Build & {
source: TestData
output: "/bin/testbin"
}
test: #up: [
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: [
"sh",
"-ec",
"""
test "$(/bin/testbin)" = "hello world"
""",
]
mount: "/bin/testbin": {
from: build
path: "/bin/testbin"
}
},
]
}

3
stdlib/go/tests/testdata/go.mod vendored Normal file
View File

@@ -0,0 +1,3 @@
module main
go 1.14

7
stdlib/go/tests/testdata/main.go vendored Normal file
View File

@@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println("hello world")
}