Skip to content

Commit

Permalink
Add conformance tests for web (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
srikrsna-buf authored Feb 15, 2024
1 parent 06902d6 commit fa7726b
Show file tree
Hide file tree
Showing 12 changed files with 3,661 additions and 350 deletions.
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ NODE18_VERSION ?= v18.16.0
NODE16_VERSION ?= v16.20.0
NODE_OS = $(subst Linux,linux,$(subst Darwin,darwin,$(shell uname -s)))
NODE_ARCH = $(subst x86_64,x64,$(subst aarch64,arm64,$(shell uname -m)))
CONFORMANCE_BROWSER ?= chrome

node_modules: package-lock.json
npm ci
Expand Down Expand Up @@ -207,7 +208,7 @@ testnode: $(BIN)/node16 $(BIN)/node18 $(BIN)/node20 $(BIN)/node21 $(BUILD)/conne
$(MAKE) conformanceserverstop

.PHONY: testconformance
testconformance: testnodeconformance
testconformance: testnodeconformance testwebconformance

.PHONY: testnodeconformance
testnodeconformance: $(BIN)/node16 $(BIN)/node18 $(BIN)/node20 $(BIN)/node21 $(BUILD)/connect-conformance
Expand All @@ -222,6 +223,20 @@ testnodeconformance: $(BIN)/node16 $(BIN)/node18 $(BIN)/node20 $(BIN)/node21 $(B
cd packages/connect-conformance && PATH="$(abspath $(BIN)):$(PATH)" node20 ./bin/connectconformance --mode client --conf conformance-node.yaml -v ./bin/conformancenodeclient
cd packages/connect-conformance && PATH="$(abspath $(BIN)):$(PATH)" node21 ./bin/connectconformance --mode client --conf conformance-node.yaml -v ./bin/conformancenodeclient

.PHONY: testwebconformance
testwebconformance: $(BUILD)/connect-conformance
npm run -w packages/connect-conformance test:web -- --browser chrome --headless
npm run -w packages/connect-conformance test:web -- --browser firefox --headless
npm run -w packages/connect-conformance test:web -- --browser node
@# Requires one to enable the 'Allow Remote Automation' option in Safari's Develop menu.
ifeq ($(NODE_OS),darwin)
npm run -w packages/connect-conformance test:web -- --browser safari --headless
endif

.PHONY: testwebconformancelocal
testwebconformancelocal: $(BUILD)/connect-conformance
npm run -w packages/connect-conformance test:web -- --browser $(CONFORMANCE_BROWSER)

.PHONY: testcloudflareconformance
testcloudflareconformance: $(BUILD)/connect-conformance
npm run -w packages/connect-conformance test:cloudflare:server
Expand Down
Loading

0 comments on commit fa7726b

Please sign in to comment.