Skip to content

Commit 4ab2ac0

Browse files
Port Compile API extensions from EOPA (#7887)
* server: port compile API Also adds e2e tests: These include coverage for ucast in the prisma setting, and thus require some JS runtime. * e2e: selectively skip e2e Compile API tests ...for macos runs, and for the go-compat suites. * server: accept timer_rego_external_resolve_ns metrics with value 0 When running the tests in a loop for a while, I would see values of 0ns for this metric. However, comparing with its non-zero values, which are often 41 or 42ns, it seems like this is just not happening in this code path. So if "almost nothing" actually goes below 1ns, it's OK. * e2e: split dep-heavy e2e tests into their own go module * Makefile: export DOCKER_RUNNING (make e2e read it) --------- Co-authored-by: Philip Conrad <[email protected]> Signed-off-by: Stephan Renatus <[email protected]>
1 parent 5816e4f commit 4ab2ac0

File tree

243 files changed

+33515
-4255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+33515
-4255
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@ updates:
1313
- "*"
1414
exclude-patterns:
1515
- "go.opentelemetry.io/*"
16+
- package-ecosystem: gomod
17+
directory: /e2e
18+
schedule:
19+
interval: monthly
20+
groups:
21+
all:
22+
patterns:
23+
- "*"
24+
- package-ecosystem: npm
25+
directory: /e2e/api/compile/prisma
26+
schedule:
27+
interval: monthly
28+
groups:
29+
e2e/prisma:
30+
patterns:
31+
- "*"
1632
- package-ecosystem: github-actions
1733
directory: /
1834
schedule:

.github/workflows/pull-request.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ jobs:
224224
with:
225225
go-version: ${{ steps.go_version.outputs.go_version }}
226226

227+
- name: Install Node
228+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
229+
227230
- name: Download generated artifacts
228231
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
229232
with:
@@ -233,6 +236,9 @@ jobs:
233236
run: make test-coverage
234237
timeout-minutes: 30
235238

239+
- name: E2E Test Golang
240+
run: make e2e
241+
236242
go-lint:
237243
name: Go Lint
238244
runs-on: ubuntu-24.04

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ GOLANGCI_LINT_VERSION := v2.4.0
3232
YAML_LINT_VERSION := 0.29.0
3333
YAML_LINT_FORMAT ?= auto
3434

35-
DOCKER_RUNNING ?= $(shell docker ps >/dev/null 2>&1 && echo 1 || echo 0)
35+
export DOCKER_RUNNING ?= $(shell docker ps >/dev/null 2>&1 && echo 1 || echo 0)
3636

3737
# We use root because the windows build, invoked through the ci-go-build-windows
3838
# target, installs the gcc mingw32 cross-compiler.
@@ -117,6 +117,13 @@ install: generate
117117
.PHONY: test
118118
test: go-test wasm-test
119119

120+
.PHONY: e2e e2e-prep
121+
e2e: e2e-prep
122+
cd e2e/ && $(GO) test $(GO_TAGS) -v ./...
123+
124+
e2e-prep:
125+
cd e2e/api/compile/prisma && npm ci
126+
120127
.PHONY: test-short
121128
test-short: go-test-short
122129

e2e/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# github.com/open-policy-agent/opa/e2e
2+
3+
This Go module is for end-to-end tests that come with dependencies we don't otherwise need for OPA, to avoid bloat in OPA's Go module's deps.
4+
5+
> [!warning]
6+
> This module should never be imported from any of the other `github.com/open-policy-agent/opa/*` packages!

0 commit comments

Comments
 (0)