diff --git a/.github/workflows/frontend-unit-tests-app-development.yml b/.github/workflows/frontend-unit-tests-app-development.yml new file mode 100644 index 00000000000..96f65709489 --- /dev/null +++ b/.github/workflows/frontend-unit-tests-app-development.yml @@ -0,0 +1,40 @@ +name: Frontend Tests + +on: + push: + paths: + - 'frontend/app-development/**' + - '.github/workflows/frontend-unit-tests-app-development.yml' + - 'package.json' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + CYPRESS_INSTALL_BINARY: 0 + +jobs: + test: + name: 'Testing app-development' + runs-on: ubuntu-latest + steps: + - name: 'Checking Out Code' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 'Installing Dependencies' + uses: ./.github/actions/yarn-install + + - name: 'Running Unit Tests' + run: yarn test:ci:app-development + + - name: 'Upload coverage reports to Codecov' + uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + directory: frontend/app-development/coverage + fail_ci_if_error: true diff --git a/.github/workflows/frontend-unit-tests.yml b/.github/workflows/frontend-unit-tests.yml index 4efcaa1853e..c4867ef8c35 100644 --- a/.github/workflows/frontend-unit-tests.yml +++ b/.github/workflows/frontend-unit-tests.yml @@ -8,7 +8,6 @@ on: - '!frontend/stats/**' - 'testdata/**' - '.github/workflows/frontend-unit-tests.yml' - - 'package.json' workflow_dispatch: concurrency: @@ -43,51 +42,3 @@ jobs: uses: github/codeql-action/analyze@v3 with: category: '/language:javascript' - - typecheck: - name: 'Typechecking and linting' - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - steps: - - name: 'Checking Out Code' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: 'Installing Dependencies' - uses: ./.github/actions/yarn-install - - - name: 'Doing the typecheck' - run: yarn typecheck - - - name: 'Running Eslint' - run: yarn lint --cache - - - name: 'Checking code style' - run: yarn run codestyle:check - - test: - name: 'Testing' - runs-on: ubuntu-latest - steps: - - name: 'Checking Out Code' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: 'Installing Dependencies' - uses: ./.github/actions/yarn-install - - - name: 'Running Unit Tests' - run: yarn test:ci - - - name: 'Upload coverage reports to Codecov' - uses: codecov/codecov-action@v5 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - directory: frontend/coverage - fail_ci_if_error: true diff --git a/frontend/app-development/layout/PageLayout.test.tsx b/frontend/app-development/layout/PageLayout.test.tsx index 5f40b22b486..3cdd40710ad 100644 --- a/frontend/app-development/layout/PageLayout.test.tsx +++ b/frontend/app-development/layout/PageLayout.test.tsx @@ -16,7 +16,7 @@ jest.mock('app-development/hooks/useWebSocket', () => ({ useWebSocket: jest.fn(), })); -describe('PageLayout', () => { +describe.skip('PageLayout', () => { afterEach(() => { jest.clearAllMocks(); }); diff --git a/frontend/app-development/layout/PageLayout.tsx b/frontend/app-development/layout/PageLayout.tsx index 95ad155c170..17236e1d31b 100644 --- a/frontend/app-development/layout/PageLayout.tsx +++ b/frontend/app-development/layout/PageLayout.tsx @@ -23,6 +23,11 @@ export const PageLayout = (): React.ReactNode => { const match = matchPath({ path: '/:org/:app', caseSensitive: true, end: false }, pathname); const { org, app } = match.params; + // Make some changes here to see if test coverage is affected. + // JUST FOR TESTING; REMOVE LATER, DO NOT MERGE + const triggerChange = 'trigger change'; + console.log(triggerChange); + const { data: orgs, isPending: orgsPending } = useOrgListQuery(); const { data: repository } = useRepoMetadataQuery(org, app); const repoOwnerIsOrg = !orgsPending && Object.keys(orgs).includes(repository?.owner?.login); diff --git a/frontend/app-development/package.json b/frontend/app-development/package.json index 981cfe8837f..19b047f0516 100644 --- a/frontend/app-development/package.json +++ b/frontend/app-development/package.json @@ -35,9 +35,11 @@ "build": "cross-env NODE_ENV=production webpack --config ../webpack.config.prod.js", "build-with-profile": "yarn build --profile --json > stats.json", "bundle-size": "npx webpack-bundle-analyzer ./stats.json", + "lint": "eslint \"frontend/**/*.ts*\"", "start": "yarn typecheck:watch & cross-env NODE_ENV=development webpack-dev-server --config ../webpack.config.dev.js --mode development", "test": "jest --maxWorkers=50%", - "typecheck": "npx tsc --noEmit", + "test:ci": "jest --ci --coverage --max-workers=2 --cacheDirectory=$(yarn config get cacheFolder)", + "typecheck": "tsc --noEmit", "typecheck:watch": "tsc --noEmit -w" } } diff --git a/package.json b/package.json index f3ddb1959d2..5f9d879c924 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "scripts": { "build": "yarn workspaces foreach -A -p run build", "lint": "eslint \"frontend/**/*.ts*\"", + "lint:app-development": "yarn workspace app-development lint", "lint:fix": "yarn run lint --fix", "codestyle:check": "prettier frontend --check", "codestyle:fix": "prettier frontend --write", @@ -93,7 +94,9 @@ "syncpack": "npx syncpack fix-mismatches && npx syncpack format && npx syncpack set-semver-ranges", "test": "jest --maxWorkers=50% --config=frontend/jest.config.js", "test:ci": "jest --ci --coverage --max-workers=2 --cacheDirectory=$(yarn config get cacheFolder) --config=frontend/jest.config.js", + "test:ci:app-development": "yarn workspace app-development test:ci", "typecheck": "tsc --noEmit -p frontend", + "typecheck:app-development": "yarn workspace app-development typecheck", "playwright:test:all": "yarn workspace playwright-studio test:all", "playwright:test:ui": "yarn workspace playwright-studio test:ui", "resourceadm:playwright:test:ui": "yarn workspace playwright-resourceadm resourceadm:test:ui",