File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838 sudo apt-get update -qq
3939 sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -qq -y dokku
4040 sudo dokku plugin:install-dependencies --core
41+ - name : install dokku redis plugin
42+ run : sudo dokku plugin:install https://github.com/dokku/dokku-redis.git redis
4143 - name : run integration tests
4244 run : sudo go test -v -count=1 -run TestIntegration ./tasks/
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package tasks
33import (
44 "omakase/subprocess"
55 "os"
6+ "strings"
67 "testing"
78)
89
@@ -25,6 +26,31 @@ func skipIfNoDokkuT(t *testing.T) {
2526 }
2627}
2728
29+ func dokkuPluginInstalled (plugin string ) bool {
30+ result , err := subprocess .CallExecCommand (subprocess.ExecCommandInput {
31+ Command : "dokku" ,
32+ Args : []string {"plugin:list" },
33+ })
34+ if err != nil {
35+ return false
36+ }
37+
38+ for _ , line := range strings .Split (result .StdoutContents (), "\n " ) {
39+ fields := strings .Fields (line )
40+ if len (fields ) > 0 && fields [0 ] == plugin {
41+ return true
42+ }
43+ }
44+ return false
45+ }
46+
47+ func skipIfPluginMissingT (t * testing.T , plugin string ) {
48+ t .Helper ()
49+ if ! dokkuPluginInstalled (plugin ) {
50+ t .Skipf ("skipping integration test: dokku plugin %q not installed" , plugin )
51+ }
52+ }
53+
2854func TestIntegrationAppCreateAndDestroy (t * testing.T ) {
2955 skipIfNoDokkuT (t )
3056
@@ -937,6 +963,7 @@ func TestIntegrationMultiTaskWorkflow(t *testing.T) {
937963
938964func TestIntegrationServiceCreateAndDestroy (t * testing.T ) {
939965 skipIfNoDokkuT (t )
966+ skipIfPluginMissingT (t , "redis" )
940967
941968 serviceName := "omakase-test-service"
942969 serviceType := "redis"
You can’t perform that action at this time.
0 commit comments