Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ADD_LICENSE_HEADER := $(BIN)/license-header \
# This version should be kept in sync with the version in buf.yaml
PROTOVALIDATE_VERSION ?= v0.14.0
# Version of the cel-spec that this implementation is conformant with
# This should be kept in sync with the version in format_test.py
# This should be kept in sync with the version in test/test_format.py
CEL_SPEC_VERSION ?= v0.24.0
TESTDATA_FILE := test/testdata/string_ext_$(CEL_SPEC_VERSION).textproto

Expand All @@ -44,7 +44,7 @@ generate: $(BIN)/buf $(BIN)/license-header ## Regenerate code and license header
$(ADD_LICENSE_HEADER)

.PHONY: format
format: install $(BIN)/license-header ## Format code
format: install $(BIN)/buf $(BIN)/license-header ## Format code
$(ADD_LICENSE_HEADER)
buf format --write .
uv run -- ruff format protovalidate test
Expand All @@ -65,7 +65,8 @@ conformance: $(BIN)/protovalidate-conformance generate install ## Run conformanc
protovalidate-conformance $(CONFORMANCE_ARGS) uv -- run python3 -m test.conformance.runner

.PHONY: lint
lint: install ## Lint code
lint: install $(BIN)/buf ## Lint code
buf format -d --exit-code
uv run -- ruff format --check --diff protovalidate test
uv run -- mypy protovalidate
uv run -- ruff check protovalidate test
Expand Down
9 changes: 3 additions & 6 deletions test/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
from protovalidate.internal import extra_func
from protovalidate.internal.cel_field_presence import InterpretedRunner

# Version of the cel-spec that this implementation is conformant with
# This should be kept in sync with the version in the Makefile
# Version of the cel-spec that this implementation is conformant with.
# This should be kept in sync with the version in ../Makefile.
CEL_SPEC_VERSION = "v0.24.0"

skipped_tests = [
Expand All @@ -36,6 +36,7 @@
# This throws an error like:
# "no such overload: IntType(0) <class 'celpy.celtypes.IntType'> !=
# BoolType(False) <class 'celpy.celtypes.BoolType'>",))
# TODO: Check if this bug is fixed in newer versions of cel-python.
"map support (all key types)",
]
skipped_error_tests = [
Expand Down Expand Up @@ -111,8 +112,6 @@ def test_format_successes(self):
prog = self._env.program(ast, functions=extra_func.make_extra_funcs())

bindings = build_variables(test.bindings)
# Ideally we should use pytest parametrize instead of subtests, but
# that would require refactoring other tests also.
with self.subTest(test.name):
try:
result = prog.evaluate(bindings)
Expand All @@ -135,8 +134,6 @@ def test_format_errors(self):
prog = self._env.program(ast, functions=extra_func.make_extra_funcs())

bindings = build_variables(test.bindings)
# Ideally we should use pytest parametrize instead of subtests, but
# that would require refactoring other tests also.
with self.subTest(test.name):
try:
prog.evaluate(bindings)
Expand Down