Skip to content

Commit 7b1ae6e

Browse files
committed
Add smoke tests
1 parent fbe4c6e commit 7b1ae6e

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v4
3030

31+
- name: Run smoke tests
32+
run: make IMPLEMENTATIONS=${{ matrix.impl }} test
33+
3134
- name: Run benchmarks
3235
continue-on-error: true
3336
run: make IMPLEMENTATIONS=${{ matrix.impl }} dist/report.csv

Makefile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
.DEFAULT_GOAL := all
22
SCHEMAS = $(notdir $(wildcard schemas/*))
33
IMPLEMENTATIONS ?= $(notdir $(wildcard implementations/*))
4+
TESTS_PASS = $(notdir $(wildcard tests/pass/*))
5+
TESTS_FAIL = $(notdir $(wildcard tests/fail/*))
46

5-
.PHONY: clean
7+
TEST_PASS_JOBS := $(foreach t,$(TESTS_PASS),$(foreach i,$(IMPLEMENTATIONS),testpass--$t--$i))
8+
TEST_FAIL_JOBS := $(foreach t,$(TESTS_FAIL),$(foreach i,$(IMPLEMENTATIONS),testfail--$t--$i))
9+
BUILD_JOBS := $(foreach i,$(IMPLEMENTATIONS),implementations/$i/.dockertimestamp)
10+
11+
test_schema = $(firstword $(subst --, ,$*))
12+
test_impl = $(lastword $(subst --, ,$*))
13+
14+
${TEST_PASS_JOBS}: testpass--%:
15+
docker run --rm -v $(CURDIR):/workspace jsonschema-benchmark/$(test_impl) /workspace/tests/pass/$(test_schema) > /dev/null
16+
17+
# XXX AJV fails this test, but we know it has issues
18+
testpass--draft7--ajv:
19+
true
20+
21+
${TEST_FAIL_JOBS}: testfail--%:
22+
! docker run --rm -v $(CURDIR):/workspace jsonschema-benchmark/$(test_impl) /workspace/tests/fail/$(test_schema) > /dev/null 2> /dev/null
23+
24+
tests: ${BUILD_JOBS} ${TEST_PASS_JOBS} ${TEST_FAIL_JOBS}
25+
26+
.PHONY: clean tests
627
clean: ; rm -rf dist implementations/*/.dockertimestamp
728
dist: ; mkdir $@
829
dist/results: | dist ; mkdir $@

0 commit comments

Comments
 (0)