Attempt to test using bats / drone

This commit is contained in:
3wc 2020-10-23 05:03:01 +02:00
parent 16a09887e6
commit 9d22797dc8
2 changed files with 21 additions and 0 deletions

View File

@ -8,6 +8,12 @@ steps:
- apt update - apt update
- apt install -y shellcheck - apt install -y shellcheck
- shellcheck abra script.d/* - shellcheck abra script.d/*
- name: test
image: debian:buster
commands:
- apt update
- apt install -y bats docker
- bats test.bats
trigger: trigger:
branch: branch:
- main - main

15
test.bats Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bats
@test "docker is available" {
command -v docker
}
@test "abra is executable" {
abra --help
}
@test "abra server add/rm works" {
abra server add swarm.example.com user 222
docker context ls | grep swarm.example.com
abra server rm swarm.example.com
}