TeslaGov / ngx-http-auth-jwt-module

Secure your NGINX locations with JWT
MIT License
317 stars 122 forks source link

Use a bash function for tests #39

Closed max-lt closed 6 years ago

max-lt commented 6 years ago

Hi there, I just did some style modifications:

kevinmichaelchen commented 6 years ago

You should use local when setting variables

kevinmichaelchen commented 6 years ago

Other than that we super appreciate the contribution. I'll let @fitzyjoe review this

fitzyjoe commented 6 years ago

Thanks @maxx-t, I like that you've separated the build from the test. Unfortunately, the tests fail for me because I'm on a mac and it's using "localhost". I'm not sure I understand the "if" for OSTYPE - none of this bash script is going to work for Windows, right? On my mac, this is what works for me. In which environment does this not work?

MACHINE_IP=`docker-machine ip 2> /dev/null`

Can we just use that line instead of the OSTYPE if block?

max-lt commented 6 years ago

Of course, that's my bad, I thought that docker machine was a kind of "docker for windows". I usually use the docker command on macOS too.

"$OSTYPE" == "darwin"* matches any macOS version (like darwin15.6.0) while "$OSTYPE" == "linux"* matches any linux (like linux-gnu).

I will reset this block to the original one.