Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bats tests fail on macOS in VSCode Dev Container with "No pack binary found" #7375

Open
salomvary opened this issue Dec 1, 2024 · 4 comments

Comments

@salomvary
Copy link

salomvary commented Dec 1, 2024

Description of problem

I'm about to make my first small contribution to Dokku and tried running the test suite locally on a fresh clone first.

Unfortunately, test fail with "No pack binary found".

Steps to reproduce

The test suite will fail with the following output:

root@abae3c8581c6:~/go/src/github.com/dokku/dokku# bats tests/unit/cron.bats 
cron.bats
 ✓ (cron) cron:help
 ✓ (cron) installed
 ✓ (cron) invalid [missing-keys]
 ✓ (cron) invalid [schedule]
 ✓ (cron) invalid [seconds]
 ✗ (cron) create [empty]
   (from function `flunk' in file tests/unit/test_helper.bash, line 69,
    from function `assert_success' in file tests/unit/test_helper.bash, line 75,
    in test file tests/unit/cron.bats, line 72)
     `assert_success' failed
                  total        used        free      shared  buff/cache   available
   Mem:            7845        3387         826           2        3831        4457
   Swap:           1023         213         810
    !     You haven't deployed any applications yet
   -----> Creating rdmtestapp-3a2428a2-9191-4a50-bec1-5ae29073a452...
   -----> Creating new app virtual host file...
   output: Initialized empty Git repository in /tmp/dokku.me.IWHEd/.git/
   setting up remote: [email protected]:rdmtestapp-3a2428a2-9191-4a50-bec1-5ae29073a452
   [master (root-commit) df4afd8] initial commit
    31 files changed, 360 insertions(+)
    create mode 100644 .env
    create mode 100644 Procfile
    create mode 100644 alt.Dockerfile
    create mode 100644 app-5205a.json
    create mode 100644 app-5205b.json
    create mode 100644 app-cnb.json
    create mode 100644 app.json
    create mode 100644 app2.json
    create mode 100644 app3.json
    create mode 100755 bin/pre_compile
    create mode 100644 check_deploy
    create mode 100755 cnb/1/bin/build
    create mode 100755 cnb/1/bin/detect
    create mode 100644 cnb/1/buildpack.toml
    create mode 100755 cnb/2/bin/build
    create mode 100755 cnb/2/bin/detect
    create mode 100644 cnb/2/buildpack.toml
    create mode 100644 dockerfile.Dockerfile
    create mode 100644 expose.Dockerfile
    create mode 100644 null
    create mode 100644 project2.toml
    create mode 100644 release.py
    create mode 100644 second.Procfile
    create mode 100644 sub-app/Procfile
    create mode 100644 sub-app/null
    create mode 100644 sub-app/release.py
    create mode 100644 sub-app/web.py
    create mode 100644 task.py
    create mode 100644 web.py
    create mode 100644 worker.Procfile
    create mode 100644 worker.py
   Pseudo-terminal will not be allocated because stdin is not a terminal.
   remote:  !     Herokuish builder not supported on arm64 servers.
   remote:  !     Switching to pack builder.
-----> Cleaning up...
-----> Building rdmtestapp-3a2428a2-9191-4a50-bec1-5ae29073a452 from cnb stack heroku/builder:24 (experimental)...
   remote: !   No pack binary found
   remote:  !     Removing invalid image tag dokku/rdmtestapp-3a2428a2-9191-4a50-bec1-5ae29073a452:latest
   remote:  !     App build failed
   To dokku.me:rdmtestapp-3a2428a2-9191-4a50-bec1-5ae29073a452
    ! [remote rejected] master -> master (pre-receive hook declined)
   error: failed to push some refs to 'dokku.me:rdmtestapp-3a2428a2-9191-4a50-bec1-5ae29073a452'
   -----> Destroying rdmtestapp-3a2428a2-9191-4a50-bec1-5ae29073a452 (including all add-ons)
   -----> Cleaning up...
   -----> Retiring old containers and images
   status: 1
   command failed with exit status 1
    !     App rdmtestapp-3a2428a2-9191-4a50-bec1-5ae29073a452 does not exist
    !     You haven't deployed any applications yet
 - (cron) create [single-verbose] (skipped: previous test failed! skipping remaining tests...)
 - (cron) create [single-short] (skipped: previous test failed! skipping remaining tests...)
 - (cron) create [multiple] (skipped: previous test failed! skipping remaining tests...)
 - (cron) injected entries (skipped: previous test failed! skipping remaining tests...)
 - (cron) cron:list --format json (skipped: previous test failed! skipping remaining tests...)
 - (cron) cron:run (skipped: previous test failed! skipping remaining tests...)

12 tests, 1 failure, 6 skipped

dokku report $APP_NAME

n/a

Additional information

  • macOS 15.1.1 (24B91)
  • Apple M1 Max
  • Docker Desktop 4.25.0 (126437)
  • VSCode 1.95.3
  • Dev Containers v0.388.0

Output of failing commands after running: dokku trace:off

No response

Output of failing commands after running: dokku trace:on

No response

@salomvary
Copy link
Author

I've also tried running make unit-test which hangs forever with the following output:

root@abae3c8581c6:~/go/src/github.com/dokku/dokku# make unit-tests
make[1]: Entering directory '/root/go/src/github.com/dokku/dokku'
running go unit tests...
docker run --rm \
        -e DOKKU_ROOT=/home/dokku \
        -e GO111MODULE=on \
        -v $PWD:/go/src/github.com/dokku/dokku \
        -w /go/src/github.com/dokku/dokku \
        golang:1.23.0 \
        bash -c "cd plugins/common && go get github.com/onsi/gomega && go test -v -p 1 -race -mod=readonly " || exit $?
docker: Error response from daemon: Mounts denied: 
The path /root/go/src/github.com/dokku/dokku is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/desktop/mac for more info.

@josegonzalez
Copy link
Member

re: the pack usage, I think whats happening is that dokku internally switches to pack if you're on arm64 (unless you've force allowed herokuish). I should probably audit all the unit tests to switch them to the null buildpack where possible, which should allow usage of herokuish in tests.

Separately, the golang unit-tests probably should run outside of isolated docker containers when executed in the devcontainer environment. We run them in docker to ensure we get a consistent golang environment (something necessary when running on a VM), but the devcontainer already has the correct golang, so thats not necessary.

@IV-R

This comment was marked as spam.

@josegonzalez
Copy link
Member

Hi @IV-R. While the instructions there are overall helpful and I don't want to discourage you from providing support, this sounds a lot like ChatGPT. It's not super useful in this case - we link to instructions on installing pack here but also a PR installing pack directly in the Dockerfile would probably be better than mal-formatted instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants