Skip to content

Commit

Permalink
web: unify unit and end-to-end tests (goauthentik#11598)
Browse files Browse the repository at this point in the history
* Just cleaning up.

* web: removing sonarjs from yet another branch.

* web: everything except the tests are up-to-date.  There was a lot, it turns out, we simply weren't using.

* web: update package.json to support WebdriverIO 9

This commit:

- Upgrades to WebdriverIO 9.1.2
- Resets our `devDependencies` collection to remove all imports that we either were not using or
  were duplicates of existing dependencies:
  - *Babel*, of all things
  - Storybook addon css user preferences, now native to Storybook 8
  - SonarJS, *again*, sigh.
  - React

- Fixes a bug where ESLint would report missing features in our build scripts
- Fixes a bug where Wdio might not reach a headless browser before timeout
- Replaces Rollup's CSSLit with Vite's CSSLit, which actually works without hacks, for testing.
- Moves the package-lock scanner to its own script, with better reporting and tool verification,
  which also cleans up the package.lock file a little.

* web: unify unit and end-to-end tests

This commit builds on the Upgrade to WebdriverIO 9.1 and provides *two* variants of the wdio.conf
file: One in `browser` mode, so that standalone component tests are uploaded to the browser and run
independently, and one in `local` mode that allows the Webdriver-DOM framework to run end-to-end
tests.  This means that both Component and End-to-End tests use the same drivers, same framework,
and same versions, and all tests for the WebUI are contained in this folder.

* Prettier just opinionatin' all over the place.

* Eslint bein' disagreeable.

* Tests embedded like ticks.

* Someday I'll get prettier to agree with my IDE.

* Re-ran the installation with resolutions enforced.

* web: fix type errors in tests

Typechecking the tests is pretty messy, first because WebdriverIO passes around a lot of `ChainablePromise` objects, which TSC does not know
how to resolve to their final form after a full `await`, and second because I used a lot of metaprogramming to provide getters for the
different kinds of subtypes (here: providers) that we are targeting.  So there are a lot of compromises here, none of which make me
spectacularly happy, but they're all well-commented, so there's that.

* But I am done with you, orc.

* Fixed broken comment.
  • Loading branch information
kensternberg-authentik authored Oct 3, 2024
1 parent dec8cfb commit 22a77a7
Show file tree
Hide file tree
Showing 41 changed files with 282 additions and 16,011 deletions.
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ updates:
- package-ecosystem: npm
directories:
- "/web"
- "/tests/wdio"
- "/web/sfe"
schedule:
interval: daily
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/ci-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,11 @@ jobs:
- prettier-check
project:
- web
- tests/wdio
include:
- command: tsc
project: web
- command: lit-analyse
project: web
exclude:
- command: lint:lockfile
project: tests/wdio
- command: tsc
project: tests/wdio
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
109 changes: 0 additions & 109 deletions tests/wdio/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions tests/wdio/.prettierignore

This file was deleted.

22 changes: 0 additions & 22 deletions tests/wdio/.prettierrc.json

This file was deleted.

41 changes: 0 additions & 41 deletions tests/wdio/Makefile

This file was deleted.

16 changes: 0 additions & 16 deletions tests/wdio/blueprints/admin-user.yaml

This file was deleted.

84 changes: 0 additions & 84 deletions tests/wdio/eslint.config.mjs

This file was deleted.

Loading

0 comments on commit 22a77a7

Please sign in to comment.