stdlib/bats: implemented integration tests

Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
This commit is contained in:
Sam Alba 2021-12-13 16:12:29 -08:00
parent 56dab104ca
commit c310a1bcdb
7 changed files with 96 additions and 1 deletions

2
stdlib/.dagger/env/bats/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# dagger state
state/**

27
stdlib/.dagger/env/bats/values.yaml vendored Normal file
View 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

View File

@ -0,0 +1,7 @@
package main
import (
"alpha.dagger.io/bats"
)
TestBats: bats.#Bats

View 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@*"
}
}
}

View File

@ -0,0 +1,6 @@
{
"dependencies": {
"bats-assert": "^2.0.0",
"bats-support": "^0.2.0"
}
}

View 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
}

View File

@ -283,4 +283,8 @@ setup() {
@test "trivy" { @test "trivy" {
dagger -e trivy up dagger -e trivy up
} }
@test "bats" {
dagger -e bats up
}