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: Fix cross OS github actions #19754

Merged
merged 16 commits into from
Nov 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 2 additions & 4 deletions .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ on:
branches:
- next
pull_request:
types: [opened, reopened, labeled, synchronize]
types: [opened, synchronize, reopened]

jobs:
build:
name: Core Unit Tests node-${{ matrix.node_version }}, ${{ matrix.os }}
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:matrix')
strategy:
fail-fast: false
matrix:
Expand All @@ -28,8 +27,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- name: install and compile
run: yarn task --task compile --start-from=auto
run: yarn task --task compile --start-from=auto --no-link
- name: test
run: yarn test --runInBand --ci
19 changes: 19 additions & 0 deletions code/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
const os = require('os');

// TODO Revisit this test later, when we have a windows machine @valentinpalkovic
const skipOnWindows = [
'lib/core-server/src/utils/stories-json.test.ts',
'lib/core-server/src/utils/StoryIndexGenerator.test.ts',
'lib/cli/src/helpers.test.ts',
'lib/core-server/src/utils/__tests__/server-statics.test.ts',
'lib/core-common/src/utils/__tests__/template.test.ts',
'addons/storyshots/storyshots-core/src/frameworks/configure.test.ts',
'lib/core-common/src/utils/__tests__/interpret-files.test.ts',
'lib/builder-manager/src/utils/files.test.ts',
'lib/cli/src/helpers.test.ts',
'lib/core-server/src/utils/__tests__/server-statics.test.ts',
'lib/core-common/src/utils/__tests__/template.test.ts',
'addons/storyshots/storyshots-core/src/frameworks/configure.test.ts',
'lib/core-common/src/utils/__tests__/interpret-files.test.ts',
'lib/builder-manager/src/utils/files.test.ts',
];

module.exports = {
cacheDirectory: '.cache/jest',
clearMocks: true,
Expand Down Expand Up @@ -51,6 +69,7 @@ module.exports = {
'/renderers/svelte/src/public-types.test.ts',
'/renderers/vue/src/public-types.test.ts',
'/renderers/vue3/src/public-types.test.ts',
...(process.platform === 'win32' ? skipOnWindows : []),
],
collectCoverage: false,
collectCoverageFrom: [
Expand Down
2 changes: 2 additions & 0 deletions code/lib/cli/__mocks__/@aw-web-design/x-default-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// TODO: Once we upgrade to Jest 28/29 we can probably remove this entire mock.
module.exports = {};
2 changes: 1 addition & 1 deletion code/lib/telemetry/src/sanitize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe(`Errors Helpers`, () => {

expect(sanitizedError.message).toEqual(expect.stringContaining(errorMessage));
expect(sanitizedError.message).toEqual(
expect.not.stringContaining(process.cwd().replaceAll(`\\`, `\\\\`))
expect.not.stringContaining(process.cwd().replace(/\\/g, `\\\\`))
);
});

Expand Down