bats-core / bats-action

Github action that setup Bats and all the bats libs: support, assert, detik, file.
MIT License
1 stars 4 forks source link

fix(compat): handle paths in bats-core >=1.11 #4

Closed davdhacs closed 3 months ago

davdhacs commented 3 months ago

v1.11.0 bats-core (released Mar 24, https://github.com/bats-core/bats-core/releases) paths break in bats-action.

It looks like the sed path rewrites do not catch all paths and we see errors like:

Bats v1.11.0 installed in /home/runner/.local/bin
...
/home/runner/.local/share/bats/bats: line 489: /home/runner/.local/lib/bats-core/validator.bash: No such file or directory

On the same repository, same version of the OS and github action runner that passed before when v1.10.0 was the latest:

Bats v1.10.0 installed in /home/runner/.local/bin
...
1..11
...
davdhacs commented 3 months ago

$BATS_LIBDIR was introduced and so the sed path rewrites do not modify this instance: https://github.com/bats-core/bats-core/compare/v1.10.0...v1.11.0#diff-cd529682f31fb50b4e5e6ac2eb7f031126ad56def53f42c44b74eb6601ad5fe3L489 libexec/bats-core/bats:

489 source "$BATS_ROOT/$BATS_LIBDIR/bats-core/validator.bash"
carlossg commented 3 months ago

the workaround is to explicitly use bats 1.10.0

      - name: Setup BATS
        uses: bats-core/bats-action@1.5.6
        with:
          bats-version: 1.10.0
brokenpip3 commented 3 months ago

Thanks for the reporting and PR, will take a look :)

brokenpip3 commented 3 months ago

@davdhacs I don't know why but I can't push into this branch (I usually be able to do it), will open another PR

brokenpip3 commented 3 months ago

https://github.com/bats-core/bats-action/pull/6

carlossg commented 3 months ago

I don't know why but I can't push into this branch (I usually be able to do it)

because the PR was created from the fork main branch instead of a new one

brokenpip3 commented 3 months ago

I don't know why but I can't push into this branch (I usually be able to do it)

because the PR was created from the fork main branch instead of a new one

yup but when you create a fork of a project and then a PR vs that project github will allow by default the maintainer of that project to push vs that specific fork branch

carlossg commented 3 months ago

not if the branch is the default one (main, master)