stdlib/bats: implemented integration tests
Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
This commit is contained in:
parent
56dab104ca
commit
c310a1bcdb
2
stdlib/.dagger/env/bats/.gitignore
vendored
Normal file
2
stdlib/.dagger/env/bats/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# dagger state
|
||||
state/**
|
27
stdlib/.dagger/env/bats/values.yaml
vendored
Normal file
27
stdlib/.dagger/env/bats/values.yaml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
plan:
|
||||
package: ./bats/tests
|
||||
name: bats
|
||||
inputs:
|
||||
TestBats.source:
|
||||
dir:
|
||||
path: ./bats/tests/testfile
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBlcFZKTkhBdy95aW1uTDdq
|
||||
OFdiMEtFcUt2UWY4bGR1R2RMOVhGaTc2L3drCjNyTEdjK3hDNEk5U1B6MVZqU3hn
|
||||
V1BnUHRKMktEVEFlWkJvS3YyeUpSY1kKLS0tIGIxQTdRUkZmR0lPRDN1RTgxN2RE
|
||||
b05uK3JiMU5Edmg2WXMvWklKWW1rYzQKXMFWBurdM3edyKq1uifIF6RXLsUaFuwP
|
||||
hYwgmcFroCYdNILt0sPgzOCQntWQevZIqITqs1vhvnxNgzDOONY7tg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2021-12-14T00:03:36Z"
|
||||
mac: ENC[AES256_GCM,data:4fAHWs24hyuGNjM3XryPXUPd2lPsQP4dvsjbEStrbZtlbEY7wP31W9ZfBXTeU92t1ocpEmcsqsR9ihQnBndvhyY5bXhdFglWV54K83R6xDAZjGknIPilvwtt/VkEZg2uSGvu6VO7MlX4hZlO6YJ7dN1EAQxmQW6yG6POuSchPfE=,iv:fPim6bWX7KqE0DS7bLBHanl4DX+EBBijvltKQl7fo8s=,tag:GWKAre5MzXtRjlCEH4yFIA==,type:str]
|
||||
pgp: []
|
||||
encrypted_suffix: secret
|
||||
version: 3.7.1
|
7
stdlib/bats/tests/bats.cue
Normal file
7
stdlib/bats/tests/bats.cue
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"alpha.dagger.io/bats"
|
||||
)
|
||||
|
||||
TestBats: bats.#Bats
|
37
stdlib/bats/tests/testfile/package-lock.json
generated
Normal file
37
stdlib/bats/tests/testfile/package-lock.json
generated
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "npm",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"bats-assert": "^2.0.0",
|
||||
"bats-support": "^0.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bats-assert": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bats-assert/-/bats-assert-2.0.0.tgz",
|
||||
"integrity": "sha512-qO3kNilWxW8iCONu9NDUfvsCiC6JzL6DPOc/DGq9z3bZ9/A7wURJ+FnFMxGbofOmWbCoy7pVhofn0o47A95qkQ==",
|
||||
"peerDependencies": {
|
||||
"bats-support": "git+https://github.com/ztombol/bats-support.git#v0.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bats-support": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "git+ssh://git@github.com/ztombol/bats-support.git#d0a131831c487a1f1141e76d3ab386c89642cdff"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"bats-assert": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bats-assert/-/bats-assert-2.0.0.tgz",
|
||||
"integrity": "sha512-qO3kNilWxW8iCONu9NDUfvsCiC6JzL6DPOc/DGq9z3bZ9/A7wURJ+FnFMxGbofOmWbCoy7pVhofn0o47A95qkQ==",
|
||||
"requires": {}
|
||||
},
|
||||
"bats-support": {
|
||||
"version": "git+ssh://git@github.com/ztombol/bats-support.git#d0a131831c487a1f1141e76d3ab386c89642cdff",
|
||||
"from": "bats-support@*"
|
||||
}
|
||||
}
|
||||
}
|
6
stdlib/bats/tests/testfile/package.json
Normal file
6
stdlib/bats/tests/testfile/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"bats-assert": "^2.0.0",
|
||||
"bats-support": "^0.2.0"
|
||||
}
|
||||
}
|
12
stdlib/bats/tests/testfile/test.bats
Normal file
12
stdlib/bats/tests/testfile/test.bats
Normal file
@ -0,0 +1,12 @@
|
||||
setup() {
|
||||
load 'node_modules/bats-support/load'
|
||||
load 'node_modules/bats-assert/load'
|
||||
}
|
||||
|
||||
@test "simple bats test" {
|
||||
run echo "Hello world"
|
||||
assert_success
|
||||
|
||||
run cat /do/not/exist
|
||||
assert_failure
|
||||
}
|
@ -284,3 +284,7 @@ setup() {
|
||||
@test "trivy" {
|
||||
dagger -e trivy up
|
||||
}
|
||||
|
||||
@test "bats" {
|
||||
dagger -e bats up
|
||||
}
|
||||
|
Reference in New Issue
Block a user