polis icon indicating copy to clipboard operation
polis copied to clipboard

Run e2e tests across more hostname conditions: http/https and localhost/ip/domain

Open patcon opened this issue 4 years ago • 0 comments

Re-ticketed from https://github.com/compdemocracy/polis/pull/1228

Currently, we are running the e2e tests in CI using the default polis.config.template.js:

https://github.com/compdemocracy/polis/blob/af475d7c7a54b1bd516721a5417db211c2ec6318/client-participation/polis.config.template.js#L21

I've just realized that while running local e2e tests using variations on this, things fail without some tweaking that I wasn't expecting:

  • bare http://localhost fails (because an assumption of https protocol is hardcoded in embed.js) https://github.com/compdemocracy/polis/blob/af475d7c7a54b1bd516721a5417db211c2ec6318/client-participation/api/embed.js#L6
  • https://127.0.0.1.sslip.io or https://123.45.67.89.sslip.io fails (because SERVICE_HOSTNAME needs to be set in order for embed.js to work) https://github.com/compdemocracy/polis/blob/af475d7c7a54b1bd516721a5417db211c2ec6318/client-participation/polis.config.template.js#L19-L21

These are some important variants in the real world, so we should figure out a way to test them in the e2e test suite. Right now, this requires 3 different docker builds, so it might be worth thinking on how to set these values more dynamics, so they can all be tested from a single build artifact.

I could imagine this could be very frustrating for someone getting things running locally for the first time, or on a remote server.

patcon avatar Dec 03 '21 20:12 patcon