Skip to content

Commit

Permalink
revert: matrix steps and jest projects (#927)
Browse files Browse the repository at this point in the history
* Revert "ci: fix release workflow (#926)"

This reverts commit d6d0757.

* Revert "ci: use matrix steps and jest projects (#919)"

This reverts commit dec53f5.
  • Loading branch information
diegopf authored Dec 14, 2022
1 parent d6d0757 commit 418eaa8
Show file tree
Hide file tree
Showing 29 changed files with 169 additions and 266 deletions.
46 changes: 0 additions & 46 deletions .github/actions/cache/action.yml

This file was deleted.

47 changes: 27 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
task: [ lint, 'test:unit', 'test:unit-cypress', 'test:e2e:ci' ]
name: ${{ matrix.task }}
container:
image: cypress/browsers:node16.16.0-chrome105-ff104-edge
# https://github.com/cypress-io/github-action#firefox Cypress FF image needs this user permissions to be able to install dependencies
Expand All @@ -19,27 +15,38 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Enables cache
id: cache
uses: ./.github/actions/cache
# Using lerna, it is recommended to cache the whole node_modules folder https://github.com/actions/cache/blob/main/examples.md#node---lerna
# but this is not the standard, normally, only the node_modules/.cache should be cached. Also, as cypress image is used, node is already
# preinstalled, the expected action `setup-node` is not used.
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#about-caching-workflow-dependencies
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
with:
task_name: ${{ matrix.task }}
path: '**/node_modules'
key: node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-cache
- name: Cache eslint
id: cache-eslint
uses: actions/cache@v3
with:
path: .eslintcache
key: eslint-${{github.sha}}
- name: Install lerna and all packages
if: steps.cache.outputs.cache-node-modules != 'true'
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Build
if: steps.cache.outputs.cache-node-modules == 'true'
if: steps.cache-node-modules.outputs.cache-hit == 'true'
run: npm run build
- name: Run ${{ matrix.task }}
run: npm run ${{ matrix.task }}
release:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Run linter in all packages
run: npm run lint
- name: Run tests in all packages
run: npm run test
- name: Release alpha on non-release pushes to main branch
if:
${{ github.ref_name == 'main' && github.actor != 'support-empathy' &&
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
**/temp
**/report
**/*.tgz
tmp

**/tests/e2e/videos/
**/tests/e2e/screenshots/
Expand Down
3 changes: 0 additions & 3 deletions jest-base.config.js

This file was deleted.

5 changes: 0 additions & 5 deletions jest.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"lint": "eslint packages --ext .ts,.tsx,.vue --quiet --cache --cache-strategy content",
"lint:fix": "eslint packages --ext .ts,.tsx,.vue --fix",
"test": "lerna run test --parallel",
"test:unit": "jest",
"test:unit-cypress": "lerna run test:unit-cypress --parallel",
"test:e2e:ci": "lerna run test:e2e:ci --parallel",
"serve": "lerna run serve --parallel",
"prepare-release:stable": "lerna version --conventional-commits --conventional-graduate --no-git-tag-version --yes",
"release:alpha": "lerna publish --conventional-commits --conventional-prerelease --yes --no-push",
Expand Down
8 changes: 4 additions & 4 deletions packages/deep-merge/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
moduleFileExtensions: ['ts', 'js'],
moduleFileExtensions: [
'ts',
'js'
],
transform: {
'^.+\\.ts?$': 'ts-jest'
},
Expand Down
3 changes: 0 additions & 3 deletions packages/get-safe-property-chain/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['<rootDir>/**/*.spec.ts']
Expand Down
3 changes: 0 additions & 3 deletions packages/logger/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
preset: 'ts-jest',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/**/*.spec.ts']
Expand Down
3 changes: 0 additions & 3 deletions packages/react-wrapper/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
preset: 'ts-jest',
testMatch: ['<rootDir>/src/**/*.spec.ts?(x)'],
// jest 27 changes the default environment to node instead of jsdom
Expand Down
3 changes: 0 additions & 3 deletions packages/storage-service/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
preset: 'ts-jest',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/**/*.spec.ts']
Expand Down
3 changes: 0 additions & 3 deletions packages/x-adapter-platform/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
moduleFileExtensions: ['ts', 'js'],
testEnvironment: 'jsdom',
transform: {
Expand Down
3 changes: 0 additions & 3 deletions packages/x-adapter/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
moduleFileExtensions: ['ts', 'js'],
roots: ['<rootDir>/src'],
testEnvironment: 'jsdom',
Expand Down
3 changes: 0 additions & 3 deletions packages/x-archetype-utils/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
moduleFileExtensions: ['ts', 'js'],
preset: 'ts-jest',
testMatch: ['<rootDir>/**/*.spec.ts'],
Expand Down
3 changes: 0 additions & 3 deletions packages/x-bus/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
moduleFileExtensions: ['ts', 'js'],
preset: 'ts-jest',
testMatch: ['<rootDir>/**/*.spec.ts'],
Expand Down
11 changes: 6 additions & 5 deletions packages/x-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Change Log

All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.0.0-alpha.249](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2022-12-14)

Expand All @@ -14,11 +14,12 @@ All notable changes to this project will be documented in this file. See

## [3.0.0-alpha.248](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2022-12-12)


### Bug Fixes

- remove warning when the event is not defined (#918)
([7f70e25](https://github.com/empathyco/x/commit/7f70e257bae41ba34f72c1c580c79862448faea9)),
closes [EX-7617](https://searchbroker.atlassian.net/browse/EX-7617)
* remove warning when the event is not defined (#918) ([7f70e25](https://github.com/empathyco/x/commit/7f70e257bae41ba34f72c1c580c79862448faea9)), closes [EX-7617](https://searchbroker.atlassian.net/browse/EX-7617)



# Change Log

Expand Down
3 changes: 0 additions & 3 deletions packages/x-components/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
preset: 'ts-jest',
transform: {
'^.+\\.vue$': require.resolve('./vue-preprocessor'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ describe('testing next queries component', () => {
nextQueries.forEach((nextQuery, index) => {
expect(eventSpansList.at(index).element.innerHTML).toEqual(nextQuery.query);
expect(eventSpansList.at(index).element.getAttribute('data-index')).toEqual(`${index}`);
expect(highlightIconList.at(index).contains('img')).toBe(false);
expect(iconsList.at(index)).toBeDefined();
expect(highlightIconList.at(index).find('img').exists()).toBe(false);
});

await wrapper.setProps({ highlightCurated: true });
highlightIconList = findTestDataById('next-query-highlight');

nextQueries.forEach((nextQuery, index) => {
expect(highlightIconList.at(index).find('img').exists()).toBe(!!nextQuery.isCurated);
expect(highlightIconList.at(index).contains('img')).toBe(!!nextQuery.isCurated);
});
});

Expand All @@ -126,12 +126,12 @@ describe('testing next queries component', () => {
<NextQuery :suggestion="suggestion"
:highlightCurated="highlightCurated">
<template #default="suggestionContentScope">
<span data-test="next-query-highlight">
<span data-test="next-query-highlight">
<img
src="./chevron-icon.svg"
v-if="suggestionContentScope.shouldHighlightCurated"
/>
</span>
</span>
<img src="./next-query-icon.svg"
class="x-next-query__icon"
data-test="icon"/>
Expand Down Expand Up @@ -164,14 +164,14 @@ describe('testing next queries component', () => {
expect(eventSpansList.at(index).element.getAttribute('data-index')).toEqual(`${index}`);
expect(iconsList.at(index)).toBeDefined();
expect(customButtonList.at(index)).toBeDefined();
expect(highlightIconList.at(index).find('img').exists()).toBe(false);
expect(highlightIconList.at(index).contains('img')).toBe(false);
});

await wrapper.setProps({ highlightCurated: true });
highlightIconList = findTestDataById('next-query-highlight');

nextQueries.forEach((nextQuery, index) => {
expect(highlightIconList.at(index).find('img').exists()).toBe(!!nextQuery.isCurated);
expect(highlightIconList.at(index).contains('img')).toBe(!!nextQuery.isCurated);
});
});

Expand Down
4 changes: 1 addition & 3 deletions packages/x-priority-queue/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
moduleFileExtensions: ['ts', 'js'],
preset: 'ts-jest',
rootDir: 'src',
testMatch: ['<rootDir>/**/*.spec.ts']
};
3 changes: 0 additions & 3 deletions packages/x-svg-converter/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
moduleFileExtensions: ['ts', 'js'],
transform: {
'^.+\\.ts?$': 'ts-jest'
Expand Down
16 changes: 10 additions & 6 deletions packages/x-svg-converter/src/__tests__/svg-to-vue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ describe('test SVG to Vue script', () => {
* Generate the SVG files used in the tests.
*/
function generateTestSVGs(): void {
if (fs.existsSync(sourcePath)) {
const absoluteSourcePath = path.resolve(process.cwd(), sourcePath);

if (fs.existsSync(absoluteSourcePath)) {
[0, 1].forEach(i => {
if (!fs.existsSync(`${sourcePath}/test_svg_${i}.svg`)) {
fs.writeFileSync(`${sourcePath}/test_svg_${i}.svg`, svgStub);
if (!fs.existsSync(`${absoluteSourcePath}/test_svg_${i}.svg`)) {
fs.writeFileSync(`${absoluteSourcePath}/test_svg_${i}.svg`, svgStub);
}
});
}
Expand All @@ -102,10 +104,12 @@ describe('test SVG to Vue script', () => {
* Remove the vue files product of the tests.
*/
function removeVueTestFiles(): void {
if (fs.existsSync(sourcePath)) {
const absoluteSourcePath = path.resolve(process.cwd(), sourcePath);

if (fs.existsSync(absoluteSourcePath)) {
[0, 1].forEach(i => {
if (fs.existsSync(`${sourcePath}/test_svg_${i}.vue`)) {
fs.rmSync(`${sourcePath}/test_svg_${i}.vue`, { recursive: true });
if (fs.existsSync(`${absoluteSourcePath}/test_svg_${i}.vue`)) {
fs.rmSync(`${absoluteSourcePath}/test_svg_${i}.vue`, { recursive: true });
}
});
}
Expand Down
11 changes: 6 additions & 5 deletions packages/x-tailwindcss/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Change Log

All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.2.0-alpha.34](https://github.com/empathyco/x/compare/@empathyco/[email protected]...@empathyco/[email protected]) (2022-12-12)


### Features

- **design-system:** Add typography component to the XDS (#905)
([f09d511](https://github.com/empathyco/x/commit/f09d511341c37c3f037d9c670066f80dab1dc760)),
closes [EX-5910](https://searchbroker.atlassian.net/browse/EX-5910)
* **design-system:** Add typography component to the XDS (#905) ([f09d511](https://github.com/empathyco/x/commit/f09d511341c37c3f037d9c670066f80dab1dc760)), closes [EX-5910](https://searchbroker.atlassian.net/browse/EX-5910)



# Change Log

Expand Down
8 changes: 4 additions & 4 deletions packages/x-translations/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const base = require('../../jest-base.config');

module.exports = {
...base,
moduleFileExtensions: ['ts', 'js'],
moduleFileExtensions: [
'ts',
'js'
],
transform: {
'^.+\\.ts?$': 'ts-jest'
},
Expand Down
Loading

0 comments on commit 418eaa8

Please sign in to comment.