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

Use sh instead of bash #404

Closed
daveisfera opened this issue Jan 25, 2017 · 1 comment
Closed

Use sh instead of bash #404

daveisfera opened this issue Jan 25, 2017 · 1 comment

Comments

@daveisfera
Copy link
Contributor

We've ran into an issue where using ajv with the alpine base in Docker causes a crash that does not happen in the debian base (see nodejs/docker-node#288). I have not been able to create a minimal reproducer, so I was hoping that running the tests against the alpine base would shed some light on the issue (unfortunately it didn't).

However, in order to get the tests to run, I had to switch the shell scripts from using bash to sh, and since there's not bash specific functionality in the scripts, they can be switched to sh without any issues. Here's the Dockerfile that I used to run the tests and if this were changed, then the sed would not be necessary:

FROM node:6.9.4-alpine

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

RUN apk add --no-cache git
RUN git clone https://github.com/epoberezkin/ajv.git .

RUN npm install --quiet
RUN git submodule update --init

RUN for f in scripts/bundle scripts/prepare-tests; do sed -i "s/bash/sh/" $f; done

CMD [ "npm", "test" ]

I ran these commands to build the container and run the tests:

docker build -t test_ajv .
docker run --rm test_ajv

It's probably also worth noting that the test-karma times out because PhantomJS isn't working with Alpine Linux (see ariya/phantomjs#14186).

@epoberezkin
Copy link
Member

I guess this file should be changed too: https://github.com/epoberezkin/ajv/blob/master/scripts/bundle ?

If you submit PR (and it works :) I will merge.

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

No branches or pull requests

2 participants