Skip to content

Commit

Permalink
fix: --shell tests failing due to non-tty environment
Browse files Browse the repository at this point in the history
  • Loading branch information
boukeversteegh authored Apr 20, 2022
2 parents 2f14733 + c2f13c4 commit b7e9790
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ on:
jobs:
ShellTest:
strategy:
fail-fast: true
fail-fast: false
matrix:
command:
- go
- aws
- dotnet
- go
- java
- node
- perl
- php
- python
- ruby
- rustc
- zip
runs-on: ubuntu-latest
Expand All @@ -23,11 +29,11 @@ jobs:
uses: actions/checkout@v2
- name: Compile
run: bin/dockerized --compile
- name: "Test: dockerized --shell ${{matrix.command}}"
env:
COMMAND: "${{matrix.command}}"
- name: "dockerized --shell ${{matrix.command}}"
run: bin/dockerized -v --shell ${{matrix.command}} -c env | tee ~/shell.log
- name: "Assert"
run: |
bin/dockerized --shell $COMMAND -c 'echo $HOST_HOSTNAME' | tee ~/shell.log
echo "Test --shell"
grep $(hostname) ~/shell.log
IntegrationTest:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
util "github.com/datastack-net/dockerized/pkg/util"
"github.com/docker/compose/v2/pkg/api"
"github.com/fatih/color"
"github.com/moby/term"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -104,7 +105,7 @@ func RunCli(args []string) (err error, exitCode int) {
},
Command: commandArgs,
AutoRemove: true,
Tty: true,
Tty: term.IsTerminal(os.Stdout.Fd()),
WorkingDir: containerCwd,
}

Expand Down

0 comments on commit b7e9790

Please sign in to comment.