GithubHelp home page GithubHelp logo

Comments (12)

infokiller avatar infokiller commented on July 18, 2024

Just to clarify, this happens on master (commit 944eb59) but not on the latest release 5.2.

from entr.

eradman avatar eradman commented on July 18, 2024

I partially addressed this in commit 7cbfb78

Run system tests using bash if /bin/sh does not have ksh features

The real change is that the old unit tests no longer exist, so make test runs the system tests which are much more rigorous. This will add a lot of dependencies to your docker image, so you probably don't want to run this as part of your build.

from entr.

infokiller avatar infokiller commented on July 18, 2024

Thanks, that fixes the original issue with the curly braces. Are there any other dependencies that are missing to run the system tests like above, other than vim and tmux?

I tried the commands below, but it fails:

build_oci_img() {
  docker build "$@" - <<EOF
  FROM debian:10
  RUN DEBIAN_FRONTEND=noninteractive apt-get \
      -o DPkg::options::="--force-confdef" \
      -o DPkg::options::="--force-confold" \
      update -y && \
    DEBIAN_FRONTEND=noninteractive apt-get \
        -o DPkg::options::="--force-confdef" \
        -o DPkg::options::="--force-confold" \
        install --no-install-recommends -y \
        make git ca-certificates gcc build-essential vim tmux
  RUN git clone https://github.com/eradman/entr/
  WORKDIR entr
  RUN ./configure && make test
EOF
}

build_oci_img

docker run --rm --interactive --tty "$(build_oci_img -q)"

I get:

...
Step 5/5 : RUN ./configure && make test
 ---> Running in 6e0e1345e194
cp Makefile.linux Makefile
cc  -D_GNU_SOURCE -D_LINUX_PORT -Imissing -DRELEASE=\"5.3\"  missing/strlcpy.c missing/kqueue_inotify.c entr.c -o entr
./system_test.sh
........
FAIL: exec a command using one-shot option
'1' != '0'
make: *** [Makefile.bsd:9: test] Error 1
The command '/bin/sh -c ./configure && make test' returned a non-zero code: 2

from entr.

eradman avatar eradman commented on July 18, 2024

It doesn't look like you're missing any dependencies.

Do the tests complete outside of Docker?

from entr.

infokiller avatar infokiller commented on July 18, 2024

No, I get this error:

./system_test.sh
.....can't find window: 0
.can't find window: 0
.can't find window: 0

FAIL: spacebar triggers utility
'waiting' != 'finished'
make: *** [Makefile.bsd:9: test] Error 1

from entr.

eradman avatar eradman commented on July 18, 2024

I couldn't reproduce this failure on an Ubuntu 11 VM. @infokiller are you running on amd64 or another platform?

from entr.

infokiller avatar infokiller commented on July 18, 2024

Yes, amd64. Do you mean Debian 11?
Does that reproduce with docker?
Using docker is likely more reliable/reproducible than a VM with an arbitrary image, so it's better to use it

from entr.

infokiller avatar infokiller commented on July 18, 2024

Also, I use Archlinux as the host system

from entr.

infokiller avatar infokiller commented on July 18, 2024

To improve reproducibility, I also pinned the image digest and commit hash so that we you the exact same one. It's still not 100% reproducible because (the packages fetched are not pinned), but it's highly unlikely you won't be able to reproduce it this way:

build_oci_img() {
  docker build "$@" - <<EOF
  FROM debian@sha256:f21a32253b030826c59cd71de36996e2fd6d820d47f40a6fc1b30d64db677837
  RUN DEBIAN_FRONTEND=noninteractive apt-get \
      -o DPkg::options::="--force-confdef" \
      -o DPkg::options::="--force-confold" \
      update -y && \
    DEBIAN_FRONTEND=noninteractive apt-get \
        -o DPkg::options::="--force-confdef" \
        -o DPkg::options::="--force-confold" \
        install --no-install-recommends -y \
        make git ca-certificates gcc build-essential vim tmux
  RUN git clone https://github.com/eradman/entr
  WORKDIR entr
  RUN git checkout -q 7cbfb78 && ./configure && make test
EOF
}

build_oci_img

docker run --rm --interactive --tty "$(build_oci_img -q)"

Output:

./system_test.sh
........
FAIL: exec a command using one-shot option
'1' != '0'
make: *** [Makefile.bsd:9: test] Error 1
The command '/bin/sh -c ./configure && make test' returned a non-zero code: 2

from entr.

eradman avatar eradman commented on July 18, 2024

Do you mean Debian 11?

Yes Debian 11

The Docker image revealed some missing dependencies: also install the procps and file packages (I'll add a check for the pgrep and file commands)

We need another line to configure git in the image

git config --global user.email "[email protected]"

The rest of the failures appear in docker build, but not docker run:

alpine:~$ docker run --rm --interactive --tty 90c01cbe20e0
root@e9ae70c0b907:/entr# ./system_test.sh
..................s...................................................................
42 tests PASSED

from entr.

infokiller avatar infokiller commented on July 18, 2024

Thanks, confirmed this works. For reference, here's the full script for testing:

build_oci_img() {
  docker build "$@" - <<EOF
  FROM debian@sha256:f21a32253b030826c59cd71de36996e2fd6d820d47f40a6fc1b30d64db677837
  RUN DEBIAN_FRONTEND=noninteractive apt-get \
      -o DPkg::options::="--force-confdef" \
      -o DPkg::options::="--force-confold" \
      update -y && \
    DEBIAN_FRONTEND=noninteractive apt-get \
        -o DPkg::options::="--force-confdef" \
        -o DPkg::options::="--force-confold" \
        install --no-install-recommends -y \
        make git ca-certificates gcc build-essential vim tmux file procps
  RUN git config --global user.email "[email protected]"
  RUN git clone https://github.com/eradman/entr
  WORKDIR entr
  RUN git checkout -q 7cbfb78
EOF
}

build_oci_img

docker run --rm --interactive --tty "$(build_oci_img -q)" bash -c './configure && make test'

from entr.

eradman avatar eradman commented on July 18, 2024

Thanks @infokiller. Added the extra requirements in commit 8b00bce

from entr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.