From b62faef52006ca812c06d40eee8b57ffd4cc146c Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Thu, 17 Apr 2025 17:41:29 +0200 Subject: [PATCH 1/2] make: add end2end target --- Makefile | 6 ++++++ README.md | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 309bbb42..13c61348 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ help: # $(ZIG) commands # ------------ .PHONY: build build-dev run run-release shell test bench download-zig wpt data get-v8 build-v8 build-v8-dev +.PHONY: end2end zig_version = $(shell grep 'recommended_zig_version = "' "vendor/zig-js-runtime/build.zig" | cut -d'"' -f2) @@ -94,6 +95,11 @@ wpt-summary: test: @TEST_FILTER='${F}' $(ZIG) build test -freference-trace --summary all +## Run demo/runner end to end tests +end2end: + @test -d ../demo + cd ../demo && go run runner/main.go + ## v8 get-v8: @printf "\e[36mGetting v8 source...\e[0m\n" diff --git a/README.md b/README.md index 5587c815..2a05f9f6 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,7 @@ First, get the tools necessary for building V8, as well as the V8 source code: make get-v8 ``` -Next, build v8. This build task is very long and cpu consuming, as you will build v8 from sources. +Next, build v8. This build task is very long and cpu consuming, as you will build v8 from sources. ``` make build-v8 @@ -243,6 +243,20 @@ For dev env, use `make build-v8-dev`. You can test Lightpanda by running `make test`. +### End to end tests + +To run end to end tests, you need to clone the [demo +repository](https://github.com/lightpanda-io/demo) into `../demo` dir. + +You have to install the [demo's node +requirements](https://github.com/lightpanda-io/demo?tab=readme-ov-file#dependencies-1) + +You also need to install [Go](https://go.dev) > v1.24. + +``` +make end2end +``` + ### Web Platform Tests Lightpanda is tested against the standardized [Web Platform From 74fa9a6b2bd9df95e09c195564e5a6c4b2b491ad Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Thu, 17 Apr 2025 17:56:17 +0200 Subject: [PATCH 2/2] ci: use the demo go runner --- .github/workflows/e2e-test.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 732c6fa6..779f2c91 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -127,21 +127,8 @@ jobs: - run: chmod a+x ./lightpanda - - name: run puppeteer links + - name: run end to end tests run: | ./lightpanda serve & echo $! > LPD.pid - node puppeteer/links.js || exit 1 + go run runner/main.go --verbose kill `cat LPD.pid` - - - name: run puppeteer dump - run: | - ./lightpanda serve & echo $! > LPD.pid - node puppeteer/dump.js || exit 1 - kill `cat LPD.pid` - - - name: run playwright connect - run: | - python3 -m http.server 1234 -d ./public & echo $! > PYTHON.pid - ./lightpanda serve & echo $! > LPD.pid - node playwright/connect.js || exit 1 - kill `cat LPD.pid` `cat PYTHON.pid`