Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
dff8413
e2e specs
hahn-kev Jul 16, 2025
9316e2b
create e2e test directory
hahn-kev Jul 16, 2025
62c2321
add a health check endpoint
hahn-kev Jul 16, 2025
9e7540b
implement fw lite launcher and tests
hahn-kev Jul 16, 2025
4524b03
setup test data managment
hahn-kev Jul 16, 2025
206f96f
setup server operations helper
hahn-kev Jul 16, 2025
5f8a0d1
ensure e2e test server is used for lexbox server
hahn-kev Jul 16, 2025
ba85331
set environment to development to allow oauth to work with self signe…
hahn-kev Jul 16, 2025
e855487
main integration tests
hahn-kev Jul 16, 2025
05ca4cd
rename config server to lexboxServer for clarity
hahn-kev Jul 16, 2025
0480115
put an id on the server div for testing
hahn-kev Jul 16, 2025
cea2577
ensure we never redirect to the login page, instead redirect home
hahn-kev Jul 16, 2025
b9d27ed
fix integration tests so they work
hahn-kev Jul 16, 2025
2d56865
get some more tests passing
hahn-kev Jul 16, 2025
a848b1b
cleanup unused stuff
hahn-kev Jul 31, 2025
a691a90
move tests into snapshots folder, along with their playwright config
hahn-kev Jul 31, 2025
630a8ef
split playwright tests into snapshot and e2e
hahn-kev Jul 31, 2025
61312dc
rework the tests, add helper endpoint for deleting a project
hahn-kev Jul 31, 2025
cc6db31
ignore test results
hahn-kev Jul 31, 2025
0febfd0
update ci to run snapshot tests
hahn-kev Jul 31, 2025
195a128
add e2e workflow job
hahn-kev Jul 31, 2025
1b27d4b
cleanup a bunch of junk from the AI
hahn-kev Jul 31, 2025
24d6b97
pre test the fw lite launcher
hahn-kev Jul 31, 2025
896520c
correct pnpm script in taskfile
hahn-kev Aug 1, 2025
7f5e1d8
don't hardcode the binary path for the launcher tests
hahn-kev Aug 5, 2025
c7182f4
ensure the correct path for permissions
hahn-kev Aug 5, 2025
3ef217b
Improve shutdown handling for FW Lite on Windows and add stdin-trigge…
hahn-kev Sep 9, 2025
eb81454
Upload Playwright test results and traces on failure in FW Lite workflow
hahn-kev Sep 9, 2025
813d116
log server output in playwright test output folder
hahn-kev Sep 10, 2025
9eb352f
chore: drop kiro specs; improve e2e gha diagnostics
myieye Jan 28, 2026
f79a76d
chore: drop kiro specs; improve e2e gha diagnostics
myieye Jan 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 86 additions & 1 deletion .github/workflows/fw-lite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ on:
- develop
- main
- shadcn-ui-main #just for now ensure PRs to this branch have checks run

permissions:
contents: read
env:
VIEWER_BUILD_OUTPUT_DIR: backend/FwLite/FwLiteShared/wwwroot/viewer
jobs:
Expand Down Expand Up @@ -112,7 +115,8 @@ jobs:
run: pnpm exec playwright install --with-deps
- name: Run snapshot tests
working-directory: frontend/viewer
run: task playwright-test-standalone
run: task test:snapshot-standalone

- name: Build viewer
working-directory: frontend/viewer
run: pnpm run build
Expand All @@ -125,6 +129,9 @@ jobs:
path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }}

frontend-component-unit-tests:
permissions:
contents: read
checks: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -366,6 +373,8 @@ jobs:
path: backend/FwLite/artifacts/sign/*.msixbundle

create-release:
permissions:
contents: write
if: ${{ github.ref_name == 'main' }}
environment:
name: production
Expand Down Expand Up @@ -420,3 +429,79 @@ jobs:
sleep 10
curl -X POST https://lexbox.org/api/fwlite-release/new-release


e2e-test:
name: E2E Tests
needs: [publish-linux]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- uses: actions/download-artifact@v4
id: download-artifact
with:
name: fw-lite-web-linux
path: fw-lite-web-linux

- name: Debug downloaded artifact contents
shell: bash
run: |
set -e
echo "download-path=${{ steps.download-artifact.outputs.download-path }}"
ls -la "${{ steps.download-artifact.outputs.download-path }}"
ls -Rla "${{ steps.download-artifact.outputs.download-path }}"

- name: set execute permissions
shell: bash
run: |
set -e
find "${{ steps.download-artifact.outputs.download-path }}" -type f -name FwLiteWeb -exec chmod +x {} +
- name: Install Task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 #v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
package_json_file: 'frontend/package.json'
- uses: actions/setup-node@v4
with:
node-version-file: './frontend/package.json'
cache: 'pnpm'
cache-dependency-path: './frontend/pnpm-lock.yaml'
- name: Prepare frontend
working-directory: frontend
run: |
pnpm install
- name: Test fw lite launcher
working-directory: frontend/viewer
env:
FW_LITE_BINARY_PATH: ${{ steps.download-artifact.outputs.download-path }}/release_linux-x64/FwLiteWeb
run: task e2e-test-helper-unit-tests

- uses: ./.github/actions/setup-k8s
with:
lexbox-api-tag: develop
ingress-controller-port: '6579' # todo, figure out if we can use https as it's required for the tests
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Playwright dependencies
working-directory: frontend/viewer
run: pnpm exec playwright install --with-deps

- name: Run E2E tests
working-directory: frontend/viewer
env:
FW_LITE_BINARY_PATH: ${{ steps.download-artifact.outputs.download-path }}/release_linux-x64/FwLiteWeb
TEST_SERVER_PORT: 6579
run: task test:e2e

- name: Upload Playwright test results and traces (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: fw-lite-e2e-test-results
if-no-files-found: ignore
path: |
frontend/viewer/tests/e2e/test-results/
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ artifacts/
project-cache.json
localResourcesCache/

# Kiro AI-generated specs (not part of repo source)
.kiro/

# Kiro-generated specs
.kiro/

#Verify
*.received.*
backend/FwLite/FwLiteShared/wwwroot/viewer
Expand Down
2 changes: 2 additions & 0 deletions backend/FwLite/FwLiteWeb/FwLiteWebServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public static WebApplication SetupAppServer(WebApplicationOptions options, Actio
options.AddFilter(new LockedProjectFilter());
options.EnableDetailedErrors = true;
}).AddJsonProtocol();
builder.Services.AddHealthChecks();

configure?.Invoke(builder);
var app = builder.Build();
Expand Down Expand Up @@ -123,6 +124,7 @@ public static WebApplication SetupAppServer(WebApplicationOptions options, Actio
app.MapImport();
app.MapAuthRoutes();
app.MapMiniLcmRoutes("/api/mini-lcm");
app.MapHealthChecks("/health");

app.MapStaticAssets();
app.MapRazorComponents<App>()
Expand Down
8 changes: 8 additions & 0 deletions backend/FwLite/FwLiteWeb/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.Extensions.Options;

//paratext won't let us change the working directory, and if it's not set correctly then loading js files doesn't work
var assemblyLocation = typeof(Program).Assembly.Location;

Check warning on line 6 in backend/FwLite/FwLiteWeb/Program.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Linux

'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.

Check warning on line 6 in backend/FwLite/FwLiteWeb/Program.cs

View workflow job for this annotation

GitHub Actions / Publish FW Lite app for Linux

'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.
var assemblyDirectory = !string.IsNullOrEmpty(assemblyLocation)
? Path.GetDirectoryName(assemblyLocation) : null;
var appDirectory = assemblyDirectory ?? AppContext.BaseDirectory;
Expand All @@ -29,5 +29,13 @@
await app.StopAsync();
});

_ = Task.Run(async () =>
{
// Wait for the "shutdown" command from stdin
while (await Console.In.ReadLineAsync() is not "shutdown") { }

await app.StopAsync();
});

await app.WaitForShutdownAsync();
}
3 changes: 3 additions & 0 deletions backend/FwLite/FwLiteWeb/Routes/AuthRoutes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public static IEndpointConventionBuilder MapAuthRoutes(this WebApplication app)
async (AuthService authService, string authority, IOptions<AuthConfig> options, [FromHeader] string referer) =>
{
var returnUrl = new Uri(referer).PathAndQuery;
if (returnUrl.StartsWith("/api/auth/login")) {
returnUrl = "/";
}
if (options.Value.SystemWebViewLogin)
{
throw new NotSupportedException("System web view login is not supported for this endpoint");
Expand Down
6 changes: 6 additions & 0 deletions backend/FwLite/FwLiteWeb/Routes/ProjectRoutes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ [FromQuery] UserProjectRole? role
_ => Results.InternalServerError("DownloadProjectByCodeResult enum value not handled, please inform FW Lite devs")
};
});
group.MapDelete("/crdt/{code}",
async (CrdtProjectsService projectService, string code) =>
{
await projectService.DeleteProject(code);
return TypedResults.Ok();
});
return group;
}
}
3 changes: 2 additions & 1 deletion frontend/viewer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ html-test-results

*storybook.log
storybook-static
"screenshots/"
screenshots/*
**/*-html-report
26 changes: 17 additions & 9 deletions frontend/viewer/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,27 @@ tasks:
test-unit:
cmd: pnpm test --project unit

playwright-test:
desc: 'runs playwright tests against already running server'
cmd: pnpm run test:playwright {{.CLI_ARGS}}
playwright-test-standalone:
desc: 'runs playwright tests and runs dev automatically, run ui mode by calling with -- --ui or use --update-snapshots'
test:snapshot:
desc: 'runs snapshot tests against already running server'
cmd: pnpm run test:snapshots {{.CLI_ARGS}}
test:snapshot-standalone:
desc: 'runs snapshot tests and runs dev automatically, run ui mode by calling with -- --ui or use --update-snapshots'
env:
AUTO_START_SERVER: true
cmd: pnpm run test:playwright {{.CLI_ARGS}}
cmd: pnpm run test:snapshots {{.CLI_ARGS}}
generate-marketing-screenshots:
desc: 'they should be in the screenshots folder'
env:
AUTO_START_SERVER: true
MARKETING_SCREENSHOTS: true
cmd: pnpm run test:playwright {{.CLI_ARGS}}
playwright-test-report:
cmd: pnpm run test:playwright-report
cmd: pnpm run test:snapshots {{.CLI_ARGS}}

test:e2e-setup:
deps: [build]
cmds:
- dotnet publish ../../backend/FwLite/FwLiteWeb/FwLiteWeb.csproj --configuration Release --self-contained --output ./dist/fw-lite-server
test:e2e:
cmd: pnpm run test:e2e {{.CLI_ARGS}}
e2e-test-helper-unit-tests:
desc: 'tests the fw lite launcher, run `setup-e2e-test` first'
cmd: pnpm test:unit --run fw-lite-launcher
9 changes: 4 additions & 5 deletions frontend/viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@
"build": "vite build",
"build-ffmpeg-worker": "vite build --config vite.config.ffmpeg-worker.ts",
"preview": "vite preview",
"pretest:playwright": "playwright install",
"test:playwright": "playwright test",
"test:playwright-report": "playwright show-report html-test-results",
"test:playwright-record": "playwright codegen",
"pretest:snapshots": "playwright install chromium",
"pretest:e2e": "playwright install chromium",
"test:snapshots": "playwright test -c ./tests/snapshots/playwright.config.ts",
"test:e2e": "playwright test -c ./tests/e2e/playwright.config.ts",
"test": "vitest run",
"test:ui": "vitest --ui",
"test:watch": "vitest",
"test:storybook": "vitest --project=storybook",
"test:unit": "vitest --project=unit",
"test:browser": "vitest --project=browser",
"check": "svelte-check",
"lint": "eslint",
"lint:report": "eslint-output",
Expand Down
Loading
Loading