Skip to content

Commit

Permalink
Merge branch 'main' into Vulcan--add-html-image-dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrohde authored Jun 28, 2023
2 parents 1348fb9 + 37478d3 commit 4794397
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 246 deletions.
28 changes: 0 additions & 28 deletions .github/actions/setup-ci-env-vars/action.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: E2E tests
on: [push]
env:
npm_config_userconfig: './.npmrc'
playwright-upload-result-path: 'playwright-results'
jobs:
playwright-run:
timeout-minutes: 15
Expand All @@ -22,12 +21,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Setup CI Environment Variables
uses: ./.github/actions/setup-ci-env-vars
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_JOB_NAME: ${{ github.job }} (${{ matrix.project }})

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -66,51 +59,3 @@ jobs:
name: playwright-artifacts
path: frontend/tests/playwright/test-results/artifacts
retention-days: 7

- name: Prepare results to upload for project matrix
if: success() || failure()
id: test-result
run: |
MATRIX_NAME=$(echo "${{ matrix.project }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
RESULT_ORIGINAL_NAME="playwright-result-$BUILD_COMMIT"
RESULT_FINAL_NAME="$RESULT_ORIGINAL_NAME-$MATRIX_NAME"
mv "frontend/$RESULT_ORIGINAL_NAME" "frontend/$RESULT_FINAL_NAME"
RESULT_PATH="frontend/$RESULT_FINAL_NAME"
echo "Result path: $RESULT_PATH"
echo "result-path=$RESULT_PATH" >> $GITHUB_OUTPUT
- name: Upload Playwright Test Result Metrics
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: ${{ env.playwright-upload-result-path }}
path: ${{ steps.test-result.outputs.result-path }}
retention-days: 1

record-playwright-metrics:
name: record-playwright-metrics
runs-on: [self-hosted, metrics-runner]
needs: [playwright-run]
if: success() || failure()
timeout-minutes: 5
steps:
- name: Checkout ifixit
uses: actions/checkout@v3
with:
repository: iFixit/ifixit
token: ${{ secrets.ACTION_PAT }}

- name: Download playwright test results
uses: actions/download-artifact@v3

- name: Install deps
run: make deps.unit-tests

- name: Combine all results
run: find "${{ env.playwright-upload-result-path }}" -type f -print0 | xargs -0 cat > playwright-all-test-results

- name: Preview the results
run: cat playwright-all-test-results

- name: Record test runs
run: cat playwright-all-test-results | Tests/Exec/report-test-run
3 changes: 3 additions & 0 deletions frontend/components/common/CompatibleDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function CompatibleDevice({
wrapper={(children) => (
<Link
href={device.deviceUrl}
flexShrink="0"
{...(!truncateModels && {
onClick: (event) => event.stopPropagation(),
})}
Expand All @@ -69,13 +70,15 @@ export function CompatibleDevice({
borderStyle="solid"
borderColor="gray.300"
borderRadius="base"
flexShrink="0"
/>
</ConditionalWrapper>
<Flex
minH="12"
flexDir="column"
alignItems="flex-start"
justifyContent="flex-start"
wordBreak="break-word"
>
<ConditionalWrapper
condition={!!device.deviceUrl}
Expand Down
2 changes: 0 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
"@types/react-dom": "18.0.8",
"@types/react-virtualized-auto-sizer": "1.0.1",
"@types/react-window": "1.8.4",
"@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "5.48.1",
"@typescript-eslint/parser": "5.48.1",
"babel-jest": "28.1.3",
Expand All @@ -126,7 +125,6 @@
"playwright-msw": "2.1.0",
"prettier": "2.7.1",
"typescript": "4.8.4",
"uuid": "^9.0.0",
"webpack": "5.73.0"
},
"nextBundleAnalysis": {
Expand Down
10 changes: 5 additions & 5 deletions frontend/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ const config: PlaywrightTestConfig = {
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? '100%' : '25%',
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: process.env.CI
? [['list'], ['./tests/playwright/fixtures/metrics-reporter.ts']]
: [
[
reporter: [
process.env.CI
? ['list']
: [
'html',
{
open: 'never', // will not try to automatically open the report in the browser if test fails
outputFolder: 'tests/playwright/test-results/reports/',
},
],
],
],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ exports[`CompatibleDevice renders and matches the snapshot 1`] = `
class="css-1tbib0t"
>
<a
class="chakra-link css-spn4bz"
class="chakra-link css-1ymncv"
href="/Device/iPhone_6s_Plus"
>
<img
alt="iPhone 6s Plus"
class="chakra-image css-wn6w1c"
class="chakra-image css-ikbo0y"
src="https://mmcelvain.cominor.com/igi/cMVbyIbIrTEbi2j5.thumbnail"
/>
</a>
<div
class="css-7k4xcc"
class="css-1q1m9jl"
>
<a
class="css-ce03x1"
Expand Down Expand Up @@ -66,17 +66,17 @@ exports[`CompatibleDevice renders and matches the snapshot with truncated varian
class="css-1tbib0t"
>
<a
class="chakra-link css-spn4bz"
class="chakra-link css-1ymncv"
href="/Device/iPhone_6s_Plus"
>
<img
alt="iPhone 6s Plus"
class="chakra-image css-wn6w1c"
class="chakra-image css-ikbo0y"
src="https://mmcelvain.cominor.com/igi/cMVbyIbIrTEbi2j5.thumbnail"
/>
</a>
<div
class="css-7k4xcc"
class="css-1q1m9jl"
>
<a
class="css-ce03x1"
Expand Down
135 changes: 0 additions & 135 deletions frontend/tests/playwright/fixtures/metrics-reporter.ts

This file was deleted.

15 changes: 0 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4794397

Please sign in to comment.