Skip to content

Commit 7492cf9

Browse files
committed
Fix memory leak test: updating libjwt and fix bash script
1 parent 2cd0b9a commit 7492cf9

File tree

5 files changed

+7
-18
lines changed

5 files changed

+7
-18
lines changed

.memory_leak/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt install -y git cmake \
99
libjansson-dev \
1010
libssl-dev
1111

12-
RUN git clone --depth 1 --branch v3.2.0 https://github.com/benmcollins/libjwt.git && \
12+
RUN git clone --depth 1 --branch master https://github.com/benmcollins/libjwt.git && \
1313
mkdir libjwt/build && \
1414
cd libjwt/build && cmake .. && make && make install
1515

.memory_leak/test/teste.t

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# vim:set ft= ts=4 sw=4 et fdm=marker:
2-
use Test::Nginx::Socket::Lua;
2+
use Test::Nginx::Socket::Lua 'no_plan';
33

44
repeat_each(10);
5-
plan tests => blocks() * repeat_each() * 2;
65
run_tests();
76

87
__DATA__

.memory_leak/test_memory_leak.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
2+
set -e
3+
set -o pipefail
24

35
echo "Running tests without valgrind"
46
TEST_NGINX_USE_VALGRIND=1 prove -r t 2>&1 | tee /tmp/result.TEST_NGINX_USE_VALGRIND

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ test.e2e:
2121
@go test -v ./...
2222

2323
test.memory_leak:
24-
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose --profile memory_leak up --build --abort-on-container-exit --no-log-prefix
25-
24+
docker build -t libjwt-memory-leak-tests --platform linux/amd64 -f .memory_leak/Dockerfile .
25+
docker run --rm --name libjwt-memory-leak-tests libjwt-memory-leak-tests
2626
lint:
2727
luacheck --std ngx_lua ./lib/
2828
luacheck -g ./test/

docker-compose.yaml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,4 @@ services:
88
ports:
99
- "8888:8888"
1010
volumes:
11-
- ./tokens:/usr/share/tokens
12-
memory_leak:
13-
profiles:
14-
- memory_leak
15-
build:
16-
context: .
17-
dockerfile: ./.memory_leak/Dockerfile
18-
volumes:
19-
- ./.memory_leak/test/teste.t:/t/teste.t
20-
- ./lib/resty/libjwt:/usr/local/openresty/lualib/resty/libjwt
21-
command: ["/bin/bash"]
22-
stdin_open: true
23-
tty: true
11+
- ./tokens:/usr/share/tokens

0 commit comments

Comments
 (0)