Skip to content

Commit

Permalink
re-add kodata symlink tests for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Jul 27, 2021
1 parent 275a059 commit 184fd4d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,11 @@ jobs:
docker run $(go run ./ publish ./ --platform=${GOOS}/${GOARCH} --preserve-import-paths) version
# Build and run the test/ binary, which should log "Hello there" served from KO_DATA_PATH
docker run $(go run ./ publish ./test --platform=${GOOS}/${GOARCH} --preserve-import-paths) --wait=false 2>&1 | grep "Hello there"
testimg=$(go run ./ publish ./test --platform=${GOOS}/${GOARCH} --preserve-import-paths)
docker run ${testimg} --wait=false 2>&1 | grep "Hello there"
# Check that symlinks in kodata are chased.
# Skip this test on Windows.
if [[ "$RUNNER_OS" == "Linux" ]]; then
docker run ${testimg} --wait=false -f HEAD
fi
1 change: 1 addition & 0 deletions test/kodata/HEAD
1 change: 1 addition & 0 deletions test/kodata/refs
3 changes: 2 additions & 1 deletion test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ import (
)

var (
f = flag.String("f", "kenobi", "File in kodata to print")
wait = flag.Bool("wait", true, "Whether to wait for SIGTERM")
)

func main() {
flag.Parse()

dp := os.Getenv("KO_DATA_PATH")
file := filepath.Join(dp, "kenobi")
file := filepath.Join(dp, *f)
bytes, err := ioutil.ReadFile(file)
if err != nil {
log.Fatalf("Error reading %q: %v", file, err)
Expand Down

0 comments on commit 184fd4d

Please sign in to comment.