I’ve been taking a look at the progress of the PR. Looks great I think only the final details are missing.
These are some of the things we may still be missing:
1. We are going to start too many containers.
Right now we have all these variables in the matrix: https://github.com/frontity/frontity/blob/42c46b74f05729c8c99f85f6f094e2c291cfdbef/.github/workflows/e2e-tests.yml#L10-L14
matrix:
target: ["both", "module", "es5"]
wordpress_version: ["latest", "5.4"]
browsers: ["chrome", "firefox", "edge"]
publicPath: ["/custom/path", "http://localhost:3001/custom/path/"]
If we add another WordPress version and Firefox, we would spin up 24 containers. If we want to add Edge, we would spin up 48 containers. I don’t think that makes sense. We need to be able to join some of these args.
Let’s see what makes and doesn’t make sense:
-
target:
- It doesn’t make sense to test
both
and module
, we can test only both
.
- It makes sense to run all the tests using
es5
instead of module
in each browser because I guess browsers may be different in the way they execute JavaScript.
- I don’t think it makes sense to test
es5
against different versions of WordPress. They are not directly related.
- I don’t think it makes sense to test
es5
against different public paths. They are not directly related.
-
wordpress_version:
- It doesn’t make sense to test against different targets and public paths anything but the latest version of WordPress. There should not be differences.
- It may make sense to test against different browsers, I guess. I’m not 100% sure.
-
browser:
- It doesn’t make sense to test the different browsers against different public paths. There should not be differences.
With those constraints, maybe we could run:
-
Test Chrome
- browser: chrome
- wordpress_version: latest
- target: module (both)
- publicPath: –
-
Test Firefox
- browser: firefox
- wordpress_version: latest
- target: module (both)
- publicPath: –
-
Test Edge
- browser: edge
- wordpress_version: latest
- target: module (both)
- publicPath: –
-
Test ES5 in Chrome
- browser: chrome
- wordpress_version: latest
- target: es5
- publicPath: –
-
Test ES5 in Firefox
- browser: firefox
- wordpress_version: latest
- target: es5
- publicPath: –
-
Test ES5 in Edge
- browser: edge
- wordpress_version: latest
- target: es5
- publicPath: –
-
Test previous WordPress version
- browser: chrome
- wordpress_version: 5.4
- target: module (both)
- publicPath: –
-
Test custom relative publicPath
- browser: chrome
- wordpress_version: latest
- target: module (both)
- publicPath: /custom/path
-
Test custom absolute publicPath
That would be 9 instead of 48
We could even reduce it if we need to by mixing some of those together or add more if we think we need to test with another configuration.
The matrix would be the args required for each test:
matrix:
args:
- "--wp-version latest --browser chrome --target both"
- "--wp-version latest --browser firefox --target both"
- "--wp-version latest --browser edge --target both"
- "--wp-version latest --browser chrome --target es5"
- "--wp-version latest --browser firefox --target es5"
- "--wp-version latest --browser edge --target es5"
- "--wp-version 5.4 --browser chrome --target both"
- "--wp-version latest --browser chrome --target both --public-path /custom/path"
- "--wp-version latest --browser chrome --target both --public-path http://localhost:3001/custom/path"
Apart from that, I made a mistake when we added the --publicPath
arg to our CLI. It should have been --public-path
because the rest of the CLI args are not using camelcase.
I’ll do a PR to fix it: Change publicPath