From 9d22797dc8bf2c81f88d01f55b93956108ee1528 Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Fri, 23 Oct 2020 05:03:01 +0200 Subject: [PATCH] Attempt to test using bats / drone --- .drone.yml | 6 ++++++ test.bats | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test.bats diff --git a/.drone.yml b/.drone.yml index 99512c0b..38dfe202 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,6 +8,12 @@ steps: - apt update - apt install -y shellcheck - shellcheck abra script.d/* + - name: test + image: debian:buster + commands: + - apt update + - apt install -y bats docker + - bats test.bats trigger: branch: - main diff --git a/test.bats b/test.bats new file mode 100644 index 00000000..9240da37 --- /dev/null +++ b/test.bats @@ -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 +}