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(): upload failed visuals artifact + perf + cleanup #8402

Open
wants to merge 118 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 115 commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
c14e307
fix(): test with missing golden running from CI should fail
ShaMan123 Sep 23, 2022
f98ec94
Update visualTestLoop.js
ShaMan123 Sep 23, 2022
0b44c00
Update visualTestLoop.js
ShaMan123 Sep 23, 2022
69c5663
Update visualTestLoop.js
ShaMan123 Sep 23, 2022
d392ced
Update visualTestLoop.js
ShaMan123 Sep 23, 2022
9b13464
Update visualTestLoop.js
ShaMan123 Sep 23, 2022
7e0ed21
Update CHANGELOG.md
ShaMan123 Sep 23, 2022
51b2590
Update visualTestLoop.js
ShaMan123 Sep 23, 2022
3d3922c
test ci
ShaMan123 Sep 23, 2022
6ee4cf1
Update visualTestLoop.js
ShaMan123 Sep 23, 2022
2d451bc
Revert "test ci"
ShaMan123 Sep 23, 2022
60ec16e
Merge branch 'master' into ci-safegurad-visual-tests
ShaMan123 Oct 19, 2022
b1025c4
Merge branch 'master' into ci-safegurad-visual-tests
ShaMan123 Oct 30, 2022
8054180
refactor visual test results
ShaMan123 Oct 30, 2022
d4c8d6a
Update testem.config.js
ShaMan123 Oct 30, 2022
958dc06
Update testem.config.js
ShaMan123 Oct 30, 2022
c47abf0
better
ShaMan123 Oct 30, 2022
49c7a31
rename
ShaMan123 Oct 30, 2022
ab94dd7
Squashed commit of the following:
ShaMan123 Oct 30, 2022
1fa1fc5
Update tests.yml
ShaMan123 Oct 30, 2022
72e5d4e
commit test regression
ShaMan123 Oct 30, 2022
788b1a0
Update tests.yml
ShaMan123 Oct 30, 2022
3217610
Revert "commit test regression"
ShaMan123 Oct 30, 2022
c40ca5b
Update CHANGELOG.md
ShaMan123 Oct 30, 2022
37e500c
build artifact
ShaMan123 Oct 30, 2022
bb0f938
Update tests.yml
ShaMan123 Oct 30, 2022
c010862
Update tests.yml
ShaMan123 Oct 30, 2022
5c21f51
Update tests.yml
ShaMan123 Oct 30, 2022
0896d93
Update tests.yml
ShaMan123 Oct 30, 2022
de2dd77
cache npm
ShaMan123 Oct 30, 2022
9789c99
perf()
ShaMan123 Oct 30, 2022
cd08112
Update build.yml
ShaMan123 Oct 30, 2022
abfca94
Update tests.yml
ShaMan123 Oct 30, 2022
f48e001
Update tests.yml
ShaMan123 Oct 30, 2022
a1492ab
fix(): logic init
ShaMan123 Nov 2, 2022
f83cc77
fix(): parallel testing
ShaMan123 Nov 2, 2022
5904ee9
Update index.mjs
ShaMan123 Nov 2, 2022
4b6da67
Merge branch 'ci-safegurad-visual-tests' into ci-visuals-action
ShaMan123 Nov 2, 2022
718c829
Revert "Revert "commit test regression""
ShaMan123 Nov 2, 2022
bb59732
Merge branch 'master' into ci-safegurad-visual-tests
ShaMan123 Nov 2, 2022
6be6797
Merge branch 'ci-safegurad-visual-tests' into ci-visuals-action
ShaMan123 Nov 2, 2022
e3cec80
Merge branch 'master' into ci-visuals-action
ShaMan123 Nov 2, 2022
65ef69c
Update tests.yml
ShaMan123 Nov 2, 2022
fda9766
Update tests.yml
ShaMan123 Nov 2, 2022
e2515de
better log file
ShaMan123 Nov 2, 2022
df2bb40
report path + dump failing always
ShaMan123 Nov 2, 2022
0be6db3
Update testem.config.js
ShaMan123 Nov 2, 2022
f48d84a
parallel testem
ShaMan123 Nov 2, 2022
2d2d768
Update index.mjs
ShaMan123 Nov 2, 2022
ddc1c8d
node parallel
ShaMan123 Nov 2, 2022
7ff2d26
Create runNodeTest.mjs
ShaMan123 Nov 2, 2022
5366ff3
Update index.mjs
ShaMan123 Nov 2, 2022
77bf95d
Update node_test_setup.js
ShaMan123 Nov 2, 2022
2153fa6
Update runNodeTest.mjs
ShaMan123 Nov 2, 2022
3935ca3
non parallel fixes
ShaMan123 Nov 2, 2022
fbb403a
Update index.mjs
ShaMan123 Nov 2, 2022
53ad3ef
Revert "Update index.mjs"
ShaMan123 Nov 2, 2022
eb8e319
verbosity
ShaMan123 Nov 2, 2022
839bbe0
Update runNodeTest.mjs
ShaMan123 Nov 2, 2022
a11156a
coverage
ShaMan123 Nov 2, 2022
04eb6f9
Update index.mjs
ShaMan123 Nov 2, 2022
0ae3ff3
Revert "Update index.mjs"
ShaMan123 Nov 2, 2022
6586e5b
add info
ShaMan123 Nov 2, 2022
ae3c340
Update appendTestResults.js
ShaMan123 Nov 2, 2022
c70760e
visual test results index!
ShaMan123 Nov 2, 2022
081df37
Update index.mjs
ShaMan123 Nov 2, 2022
3fb364b
Revert "Revert "Revert "commit test regression"""
ShaMan123 Nov 2, 2022
c6c886f
Update index.mjs
ShaMan123 Nov 2, 2022
988767c
try w/o build artifact
ShaMan123 Nov 2, 2022
b67ffe9
Revert "try w/o build artifact"
ShaMan123 Nov 2, 2022
60dae3b
try w/o build artifact
ShaMan123 Nov 2, 2022
9f79387
Update index.mjs
ShaMan123 Nov 3, 2022
5230c45
shared artifact
ShaMan123 Nov 3, 2022
f4c08e7
merge coverage
ShaMan123 Nov 3, 2022
48e6e9f
Revert "Revert "Revert "Revert "commit test regression""""
ShaMan123 Nov 3, 2022
fb7774d
fixes
ShaMan123 Nov 3, 2022
de72bc2
Update tests.yml
ShaMan123 Nov 3, 2022
9350659
Update tests.yml
ShaMan123 Nov 3, 2022
29bebb9
Revert "Revert "Revert "Revert "Revert "commit test regression"""""
ShaMan123 Nov 3, 2022
ce34677
remove cmd
ShaMan123 Nov 3, 2022
afa031f
fix if passing
ShaMan123 Nov 3, 2022
60c1078
commit unit test regression
ShaMan123 Nov 3, 2022
e43c63c
Revert "commit unit test regression"
ShaMan123 Nov 3, 2022
7ed386c
add coverage warning not supported
ShaMan123 Nov 3, 2022
1d9c4ed
fix(): wrong stats when changing index
ShaMan123 Nov 4, 2022
2aa09a4
restore browser matrix
ShaMan123 Nov 4, 2022
bd09747
cleanup
ShaMan123 Nov 4, 2022
d2d206c
timeout qunit
ShaMan123 Nov 4, 2022
d543387
Update visualTestLoop.js
ShaMan123 Nov 4, 2022
4c0a316
MAJOR(): cleanup tests
ShaMan123 Nov 4, 2022
aa6af1b
Update GoldensServer.js
ShaMan123 Nov 4, 2022
fa89159
fetch
ShaMan123 Nov 4, 2022
689a52a
Update GoldensServer.js
ShaMan123 Nov 4, 2022
450e29c
fetch
ShaMan123 Nov 4, 2022
581e822
b
ShaMan123 Nov 4, 2022
0140630
fix(): qp
ShaMan123 Nov 4, 2022
eaa59d7
Update GoldensServer.js
ShaMan123 Nov 4, 2022
fa96886
Update visualTestLoop.js
ShaMan123 Nov 4, 2022
b279a50
Update z_svg_export.js
ShaMan123 Nov 4, 2022
00ac324
Update visualUtil.node.js
ShaMan123 Nov 4, 2022
f7d92d6
fix
ShaMan123 Nov 4, 2022
6176585
Revert "Revert "Revert "Revert "Revert "Revert "commit test regressio…
ShaMan123 Nov 4, 2022
abd5044
Update tests.yml
ShaMan123 Nov 4, 2022
6727e30
Revert "Revert "Revert "Revert "Revert "Revert "Revert "commit test r…
ShaMan123 Nov 4, 2022
cb22c30
Delete color-burn.png
ShaMan123 Nov 4, 2022
4375ff5
Revert "Delete color-burn.png"
ShaMan123 Nov 4, 2022
f233f10
extract qunitSetup + rename
ShaMan123 Nov 5, 2022
27547e1
Update nodeSetup.js
ShaMan123 Nov 5, 2022
c5da474
rename for consistency
ShaMan123 Nov 5, 2022
890cde4
Update visualTestLoop.js
ShaMan123 Nov 5, 2022
e3faf65
pixelmatch from node_modules
ShaMan123 Nov 5, 2022
2b34f3c
extract
ShaMan123 Nov 5, 2022
5e4fbaf
declutter
ShaMan123 Nov 5, 2022
b52c63a
more declutter
ShaMan123 Nov 5, 2022
75b6fcb
fix
ShaMan123 Nov 5, 2022
42c41f7
try w/o action
ShaMan123 Nov 6, 2022
21a91d1
Merge branch 'master' into ci-visuals-action
ShaMan123 Nov 27, 2022
4888b1d
fix merge conflict
ShaMan123 Nov 27, 2022
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
64 changes: 25 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,16 @@ on:
jobs:
build:
runs-on: ubuntu-latest
outputs:
stats: ${{ steps.b.outputs.result }}
steps:
- uses: actions/checkout@v3
- name: Uglified build
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: npm ci
- run: npm run build
stats:
name: Build stats
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: npm
- run: npm ci
- name: build stats
run: npm run build -- -s
- run: npm run build -- -s
- name: persist
id: b
uses: actions/github-script@v6
Expand All @@ -39,8 +28,21 @@ jobs:
size: JSON.parse(fs.readFileSync('cli_output/build_size.json')),
stats: JSON.parse(fs.readFileSync('cli_output/build_stats.json')),
});
stats:
name: Build stats
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: npm
- run: npm ci
- name: checkout src files
run: git checkout origin/master -- src
run: git checkout origin/master -- src index.js HEADER.js
- name: upstream build stats
run: npm run build -- -s
- name: persist
Expand All @@ -65,46 +67,30 @@ jobs:
context,
core,
a: JSON.parse('${{ steps.a.outputs.result }}'),
b: JSON.parse('${{ steps.b.outputs.result }}'),
b: JSON.parse('${{ needs.build.outputs.stats }}'),
});
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Linting
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: npm
- run: npm ci
- run: npm run lint
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Prettier check
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: npm
- run: npm ci
- run: npm run prettier:check
coverage:
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Code Coverage Report Updater
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: npm ci
- run: npm run build -- -f
- run: npm run test:coverage && npm run test:visual:coverage
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consolidated the cmd into a single run, better perf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use instead npm test -- --coverage

- run: npm run coverage:report
- uses: ShaMan123/lcov-reporter-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
delete-old-comments: true
update-comment: true
changelog:
if: ${{ always() }}
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/npmpublish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: node publish-next.js
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run build
Expand Down
63 changes: 46 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,76 @@ on:

jobs:
browser:
name: ${{ matrix.target }} ${{ matrix.suite }} tests
name: ${{ matrix.target }} tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
target: [chrome, firefox]
suite: [unit, visual]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Unit tests on Chrome
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run build -- -f
- name: Run ${{ matrix.target }} ${{ matrix.suite }} headless test
- name: Run browser headless test
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test -- -c ${{ matrix.target }} -s ${{ matrix.suite }}
run: npm run test -- -c ${{ matrix.target }} -s unit visual
- name: Archive test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-results
path: cli_output/test_results
node:
runs-on: ubuntu-latest
name: Node ${{ matrix.node-version }} ${{ matrix.suite }} tests
name: Node ${{ matrix.node-version }} tests
strategy:
fail-fast: false
matrix:
# For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# supported Node.js release schedule: https://nodejs.org/en/about/releases/
node-version: [14.x, 16.x, 18.x]
suite: [unit, visual]
node-version: [14, 16, 18]
env:
flag: ${{ (matrix.node-version == 16 && '--coverage') || '' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install node-canvas
run: sudo apt-get install libgif-dev libpng-dev libpango1.0-dev libjpeg8-dev librsvg2-dev libcairo2-dev
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node-version }}.x
cache: npm
- run: npm ci
- name: Build
run: npm run build -- -f
- name: Run ${{ matrix.suite }} tests
run: npm run test -- -c node -s ${{ matrix.suite }}
- run: npm run build -- -f
- name: Run tests
run: npm run test -- -c node -a ${{ env.flag }}
- name: Prepare Coverage Report
if: matrix.node-version == 16 && always()
run: npm run coverage:report
- name: Post Coverage Report
if: matrix.node-version == 16 && always()
uses: ShaMan123/lcov-reporter-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
delete-old-comments: true
update-comment: true
- name: Rename artifact (*node > *node${{ matrix.node-version }})
if: failure()
run: |
mv cli_output/test_results/visual/node.txt cli_output/test_results/visual/node${{ matrix.node-version }}.txt
mv cli_output/test_results/unit/node.txt cli_output/test_results/unit/node${{ matrix.node-version }}.txt
src=cli_output/test_results/visual/node
[ ! -d $src ] || mv $src ${src}${{ matrix.node-version }}
- name: Archive visual test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-results
path: cli_output/test_results
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [next]

- ci(): fixed visual tests not to create a missing golden when running from CI and to fail instead + improve visual test suite [#8311](https://github.com/fabricjs/fabric.js/pull/8311)
- chore(TS): migrate Rect [#8411](https://github.com/fabricjs/fabric.js/pull/8411)
- chore(TS): migrate Ellipse [#8408](https://github.com/fabricjs/fabric.js/pull/8408)
- chore(TS): migrate Triangle to TS [#8410](https://github.com/fabricjs/fabric.js/pull/8410)
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@
"test:unit-browser": "npm run test -- -s unit -p 8080 -l -c ",
"test:visual-browser": "npm run test -- -s visual -p 8080 -l -c ",
"test": "npm run cli -- test",
"test:coverage": "nyc --silent qunit test/node_test_setup.js test/lib test/unit",
"test:visual:coverage": "nyc --silent --no-clean qunit test/node_test_setup.js test/lib test/visual",
"coverage:report": "nyc report --reporter=lcov --reporter=text",
"lint": "eslint --config .eslintrc.js src/**/*.ts",
"lint_tests": "eslint test/unit --config .eslintrc_tests && eslint test/visual --config .eslintrc_tests",
Expand Down
5 changes: 2 additions & 3 deletions scripts/dirname.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const __dirname = path.dirname(__filename);
export const wd = path.resolve(__dirname, '..');
export const dumpsPath = path.resolve(wd, 'cli_output');
export const CLI_CACHE = path.resolve(dumpsPath, 'cli_cache.json');
export const testResultsPath = path.resolve(dumpsPath, 'test_results');

if (!fs.existsSync(dumpsPath)) {
fs.mkdirSync(dumpsPath);
}
fs.ensureDir(dumpsPath);
Loading