-
Notifications
You must be signed in to change notification settings - Fork 2
Tests support. #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Tests support. #10
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a724a42
add: tests.
ItzNotABug 736bab0
add: folder for ignore.
ItzNotABug cbd9562
update: formatter to include tests as well.
ItzNotABug a180a3c
ci.
ItzNotABug 1325bc0
update: dockerignore.
ItzNotABug 1c9761f
update: start container.
ItzNotABug a093f68
wait.
ItzNotABug 699ab33
add: logs.
ItzNotABug e401100
fix: crash-handler.
ItzNotABug 1585d37
Merge branch 'main' into tests
ItzNotABug 118b209
address comments.
ItzNotABug bd5a5f2
ignore test results.
ItzNotABug 307c739
fix: test.
ItzNotABug 6fbdd55
add: more test cases.
ItzNotABug 66d30f4
add: more test cases.
ItzNotABug 81992c2
add: more unit test cases.
ItzNotABug 5b95010
use: less heavy site.
ItzNotABug 785ffa5
address comment.
ItzNotABug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ LICENSE | |
| # Test artifacts | ||
| test-screenshots/ | ||
| comparison/ | ||
| .lighthouse/ | ||
|
|
||
| # Build output | ||
| dist/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: "Test" | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| tests: | ||
| name: "Unit and E2E Tests" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v1 | ||
| with: | ||
| bun-version: 'latest' | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install --frozen-lockfile | ||
|
|
||
| - name: Run unit tests | ||
| run: bun test:unit | ||
|
|
||
| - name: Start container | ||
| run: docker compose up -d | ||
|
|
||
| - name: Wait for container to be ready | ||
| run: | | ||
| for i in {1..30}; do | ||
| if curl -f http://localhost:3000/v1/health > /dev/null 2>&1; then | ||
| echo "Container is ready!" | ||
| exit 0 | ||
| fi | ||
| echo "Waiting for container... ($i/30)" | ||
| sleep 1 | ||
| done | ||
| echo "Container failed to start" | ||
| echo "Container logs:" | ||
| docker compose logs | ||
| exit 1 | ||
|
|
||
| - name: Run e2e tests | ||
| run: bun test:e2e | ||
|
|
||
| - name: Print logs | ||
| if: failure() | ||
| run: docker compose logs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,3 +144,5 @@ dist | |
| # Test artifacts | ||
| test-screenshots/ | ||
| comparison/ | ||
| .lighthouse/ | ||
| lighthouse/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| export * from "./browser.js"; | ||
| export * from "./lighthouse.js"; | ||
|
|
||
| export const port = Number(process.env.PORT) || 3000; | ||
| export const port = process.env.PORT ? Number(process.env.PORT) : 3000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.