Skip to content
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

Ci testing #227

Closed
wants to merge 117 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
cb86ceb
added lighthouserc.js file and lighthouse_pipeline.
shreybaz Apr 10, 2024
37eb86e
updated lighthouse_pipeline.
shreybaz Apr 10, 2024
86654bc
updated lighthouse_pipeline.
shreybaz Apr 10, 2024
49e4a6c
updated lighthouse_pipeline.
shreybaz Apr 10, 2024
ae6a266
updated lighthouse_pipeline
shreybaz Apr 10, 2024
41546dd
updated lighthouse_pipeline
shreybaz Apr 10, 2024
642d571
Update ligthouse_testing_ci.yml added env val
shreybaz Apr 11, 2024
b83e44c
Update ligthouse_testing_ci.yml
shreybaz Apr 11, 2024
d6fdc00
Update lighthouserc.js
shreybaz Apr 11, 2024
09ff714
Update ligthouse_testing_ci.yml
shreybaz Apr 11, 2024
b26a72a
Update ligthouse_testing_ci.yml
shreybaz Apr 12, 2024
25c94ce
updated
shreybaz Apr 12, 2024
a043acb
updated
shreybaz Apr 12, 2024
b89251b
Update ligthouse_testing_ci.yml
shreybaz Apr 13, 2024
8272075
Update ligthouse_testing_ci.yml
shreybaz Apr 13, 2024
1b6ead6
Update ligthouse_testing_ci.yml
shreybaz Apr 13, 2024
9d4a983
restore ligthouse_testing_ci.yml
shreybaz Apr 13, 2024
057645d
Update ligthouse_testing_ci.yml
shreybaz Apr 13, 2024
8665c70
Update ligthouse_testing_ci.yml
shreybaz Apr 13, 2024
d3835c4
Update ligthouse_testing_ci.yml
shreybaz Apr 13, 2024
c7e8224
Update ligthouse_testing_ci.yml
shreybaz Apr 15, 2024
603210c
Update ligthouse_testing_ci.yml
shreybaz Apr 15, 2024
4afc0cc
Update ligthouse_testing_ci.yml
shreybaz Apr 15, 2024
62aa81c
Update ligthouse_testing_ci.yml
shreybaz Apr 15, 2024
cb67eea
Update ligthouse_testing_ci.yml
shreybaz Apr 15, 2024
8f93f93
Update ligthouse_testing_ci.yml
shreybaz Apr 15, 2024
0c2edb4
Update ligthouse_testing_ci.yml
shreybaz Apr 15, 2024
d82f766
Update lighthouserc.js
shreybaz Apr 16, 2024
fe475f7
Update lighthouserc.js
shreybaz Apr 16, 2024
4ae4020
Update ligthouse_testing_ci.yml
shreybaz Apr 18, 2024
34323d3
Update ligthouse_testing_ci.yml
shreybaz Apr 18, 2024
cf94817
Update ligthouse_testing_ci.yml
shreybaz Apr 18, 2024
3a75f0a
Update ligthouse_testing_ci.yml build locally on PR
shreybaz Apr 18, 2024
957c9e2
Update lighthouserc.js
shreybaz Apr 18, 2024
ed66df2
Update ligthouse_testing_ci.yml
shreybaz Apr 18, 2024
1fa895f
added playwright
shreybaz Apr 22, 2024
7280b75
added playwright
shreybaz Apr 22, 2024
e56eefe
Update lighthouserc.js
shreybaz Apr 22, 2024
533fcb0
Update ligthouse_testing_ci.yml
shreybaz Apr 22, 2024
63e409b
Update ligthouse_testing_ci.yml
shreybaz Apr 22, 2024
520159c
Update ligthouse_testing_ci.yml
shreybaz Apr 22, 2024
afc7269
Update ligthouse_testing_ci.yml
shreybaz Apr 22, 2024
6df9b8d
update playwright test, added upload test
shreybaz Apr 23, 2024
90fd0bd
Update example.spec.js
shreybaz Apr 24, 2024
f3a22a1
Update ligthouse_testing_ci.yml
shreybaz Apr 24, 2024
e08be72
Update ligthouse_testing_ci.yml
shreybaz Apr 24, 2024
54e6322
Update ligthouse_testing_ci.yml
shreybaz Apr 24, 2024
f9e75c6
update playwright test
shreybaz Apr 24, 2024
501e77b
update playwright test
shreybaz Apr 24, 2024
947fdca
update playwright test
shreybaz Apr 24, 2024
3a722dd
Update ligthouse_testing_ci.yml
shreybaz Apr 24, 2024
84b89ae
update playwright test
shreybaz Apr 25, 2024
e2d798d
added like test
shreybaz Apr 29, 2024
44157c8
updated CI added google chat notification
shreybaz May 1, 2024
87045f5
Update ligthouse_testing_ci.yml
shreybaz May 1, 2024
7c5b75e
updated CI and reffer test
shreybaz May 1, 2024
8df04a1
updated CI
shreybaz May 1, 2024
5efa762
updated tests to fail
shreybaz May 1, 2024
3bdf45f
updated tests to fail
shreybaz May 1, 2024
ef5dede
updated tests to fail
shreybaz May 1, 2024
b094308
updated tests to fail
shreybaz May 1, 2024
a9a539a
updated tests to fail
shreybaz May 1, 2024
f4ecdb0
updated tests to fail
shreybaz May 1, 2024
e048bf5
updated tests to fail
shreybaz May 1, 2024
f7178fd
updated tests to fail
shreybaz May 1, 2024
490e0c4
updated tests to fail
shreybaz May 1, 2024
1dfcec2
updated tests to fail
shreybaz May 1, 2024
f4e7b73
Update ligthouse_testing_ci.yml
shreybaz May 1, 2024
63cba06
updated tests to fail
shreybaz May 2, 2024
ad60e6d
updated tests to fail
shreybaz May 2, 2024
176070e
Update ligthouse_testing_ci.yml
shreybaz May 2, 2024
0230e67
Merge branch 'lighthouse_testing_pipeline' of https://github.com/shre…
shreybaz May 2, 2024
ca9f12e
updated playwright to fail
shreybaz May 2, 2024
30338c2
updated
shreybaz May 2, 2024
31b3630
updated tests to fail
shreybaz May 2, 2024
ee5e2a3
updated tests to fail
shreybaz May 2, 2024
d83ea3d
updated tests
shreybaz May 2, 2024
5ca3c51
updated tests
shreybaz May 2, 2024
07b4c90
Update ligthouse_testing_ci.yml
shreybaz May 5, 2024
1badf14
Update ligthouse_testing_ci.yml
shreybaz May 5, 2024
7b27f8a
updated token for post deploy action
shreybaz May 5, 2024
1259c57
updated ci for lhci reort
shreybaz May 6, 2024
a6864af
updated ci for lhci reort
shreybaz May 6, 2024
bb725d5
updated ci for lhci report
shreybaz May 6, 2024
c4b3741
updated ci for lhci report
shreybaz May 6, 2024
86645a2
Update ligthouse_testing_ci.yml
shreybaz May 6, 2024
d8091d4
Update ligthouse_testing_ci.yml
shreybaz May 6, 2024
8c2de9e
updated ci for lhci report in body
shreybaz May 6, 2024
fc41e8f
updated ci for lhci report in body
shreybaz May 6, 2024
313bb50
Update ligthouse_testing_ci.yml
shreybaz May 6, 2024
bb4cd85
updated ci for lighthouse report in pr comment
shreybaz May 7, 2024
9b0cbcd
updated lhci test
shreybaz May 7, 2024
469dc05
Update ligthouse_testing_ci.yml
shreybaz May 7, 2024
90da7bb
updated lhci test
shreybaz May 7, 2024
5655360
Update ligthouse_testing_ci.yml
shreybaz May 7, 2024
e877967
Update ligthouse_testing_ci.yml
shreybaz May 7, 2024
a92e4c0
Update ligthouse_testing_ci.yml
shreybaz May 7, 2024
b462b15
updated lhci test
shreybaz May 7, 2024
49b5582
updated lhci test
shreybaz May 7, 2024
46b3d4b
updated lhci test
shreybaz May 8, 2024
0e36df1
updated lhci test
shreybaz May 8, 2024
26825bc
updated pipeline, removed foo lhci test
shreybaz May 14, 2024
8f4a273
updated pipeline, added foo lhci test
shreybaz May 14, 2024
c90cedc
updated pipeline, removed lighthouse test
shreybaz May 14, 2024
f3a2c89
updated pipeline, added check for lhci test reports
shreybaz May 15, 2024
8c2981b
updated pipeline, added check for lhci test reports
shreybaz May 15, 2024
3ed04e5
updated pipeline, added pr comment for lhci test reports
shreybaz May 15, 2024
31a89ef
updated pipeline, added pr comment for lhci
shreybaz May 15, 2024
d691eb7
Update ligthouse_testing_ci.yml
shreybaz May 15, 2024
b8ef9e0
Update ligthouse_testing_ci.yml
shreybaz May 15, 2024
9fe54b0
Update ligthouse_testing_ci.yml
shreybaz May 15, 2024
a93504e
Update ligthouse_testing_ci.yml
shreybaz May 15, 2024
85ab7ed
Update ligthouse_testing_ci.yml
shreybaz May 15, 2024
c470b91
Update ligthouse_testing_ci.yml
shreybaz May 15, 2024
12b349c
Update ligthouse_testing_ci.yml
shreybaz May 15, 2024
f916ff3
Update ligthouse_testing_ci.yml
shreybaz May 15, 2024
943ba41
added post deploy call for e2e test repo
shreybaz May 19, 2024
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
118 changes: 118 additions & 0 deletions .github/workflows/ligthouse_testing_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Generate lighthouse test report on PR
on:
pull_request:
branches: [ main, lighthouse_testing_pipeline ]

jobs:
lhci:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install


# - name: Install Lighthouse
# run: npm install -g @lhci/[email protected]

# - name: Run Lighthouse
# id: lhcitests
# run: lhci autorun
# env:
# LHCI_GITHUB_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}

# - name: install playwright
# run: npx playwright install

# - name: run playwright
# id: tests
# run: npx playwright test --project=firefox
# # continue-on-error: true

# - name: Notify on Google Chat
# uses: Co-qn/google-chat-notification@v1
# with:
# name: test
# url: ${{ secrets.TEST_WEBHOOK_URL }}
# status: ${{ steps.tests.outcome }}

# close-pr:
# if: ${{ needs.lhci.result != 'failure' }}
# needs: lhci
# runs-on: ubuntu-latest
# steps:
# - run: gh pr close "$NUMBER" --comment "$COMMENT"
# env:
# GITHUB_TOKEN: ${{ secrets.NEW_GITHUB_APP_TOKEN }}
# GH_REPO: ${{ github.repository }}
# NUMBER: ${{ github.event.number }}
# COMMENT: >
# "Playwright tests failed. Closing this pull request."




# - name: Check test result and comment
# uses: peter-evans/create-or-update-comment@v1
# with:
# token: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
# issue-number: ${{ github.event.pull_request.number }}
# body: |
# ${{ steps.tests.outcome == 'failed' && 'Test failed, Please check logs for details.' || 'Test passed :heavy_check_mark:' }}


# # foo lhci test to comment Lighthouse score to PR
# - uses: actions/checkout@master
# - run: mkdir -p ${{ github.workspace }}/tmp/artifacts
# - name: lighthouseCheck
# uses: foo-software/lighthouse-check-action@master
# with:
# outputDirectory: ${{ github.workspace }}/tmp/artifacts
# gitHubAccessToken: ${{ secrets.NEW_GITHUB_APP_TOKEN }}
# urls: 'https://yral.com/'

# - name: Notify on Google Chat
# uses: Co-qn/google-chat-notification@v1
# with:
# name: test
# url: ${{ secrets.TEST_WEBHOOK_URL }}
# status: ${{ steps.lighthouseCheck.outputs }}


# - name: Verify Lighthouse Check results
# uses: foo-software/lighthouse-check-status-action@master
# with:
# lighthouseCheckResults: ${{ steps.lighthouseCheck.outputs.lighthouseCheckResults }}
# minAccessibilityScore: "90"
# minBestPracticesScore: "90"
# minPerformanceScore: "50"
# minProgressiveWebAppScore: "50"
# minSeoScore: "50"


# - name: Upload artifacts
# uses: actions/upload-artifact@master
# with:
# name: Lighthouse reports
# path: ${{ github.workspace }}/tmp/artifacts


# call another repo as post deploy action
- name: Trigger a workflow in another repo
uses: actions/github-script@v5
with:
script: |
github.rest.repos.createDispatchEvent({
owner: 'go-bazzinga',
repo: 'hot-or-not-web-leptos-ssr-e2e-test',
event_type: 'call',

client_payload: { ref: "playwright_testing" }
});
github-token: ${{ secrets.NEW_GITHUB_APP_TOKEN }}
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ redb-kv.db
.env

# ide config
.idea/
.idea/

# lighthousece reports
.lighthouseci/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
10 changes: 0 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,3 @@ lib-default-features = false
#
# Optional. Defaults to "release".
lib-profile-release = "wasm-release"

# Pass additional parameters to the cargo process compiling to WASM
#
# Optional. No default
lib-cargo-args = ""

# Pass additional parameters to the cargo process to build the server
#
# Optional. No default
bin-cargo-args = ""
20 changes: 15 additions & 5 deletions end2end/tests/example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import { test, expect } from "@playwright/test";
// @ts-check
import { test, expect } from '@playwright/test';

test("homepage has title and links to intro page", async ({ page }) => {
await page.goto("http://localhost:3000/");
test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');

await expect(page).toHaveTitle("Welcome to Leptos");
// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
});

test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');

// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();

await expect(page.locator("h1")).toHaveText("Welcome to Leptos!");
// Expects page to have a heading with the name of Installation.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});
16 changes: 16 additions & 0 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
ci: {
collect: {
url: ['https://yral.com/'],
},
upload: {
target: 'temporary-public-storage',
},
assert: {
assertions: {
"categories:performance": ["warn", {"minScore": 0.3}],
"categories:accessibility": ["warn", {"minScore": 0.5}]
},
},
},
};
Loading
Loading