google / sxg-rs

A set of tools for generating signed exchanges at serve time.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add end-to-end tests to CI

twifkak opened this issue · comments

#41 runs the unit tests for Rust & TypeScript. Add to this, something that tests that they interact correctly with each other and with the Cloudflare Worker environment. Ideas:

End-to-end tests:

Integration tests for individual TS functions:

As an interim solution, maybe some almost e2e tests, like a CLI SXG generator and a shell script that pipes it to dump-signedexchange -verify.

Plus wrangler build and the fastly_compute equivalent.

I'm thinking at a minimum the test plan should be a matrix of:

Accept header:

  • prefers SXG
  • doesn't prefer SXG

Response:

  • small (<8MB) HTML
  • small HTML + <meta charset=utf-8>
  • small HTML + <meta charset=utf-8> + UTF-16 encoding with BOM
  • large (>8MB) HTML + <meta charset=utf-8>
  • small non-HTML
  • large non-HTML

Another possible alternative to wrangler dev is Cloudflare's Miniflare which is a local Workers emulator.