diff --git a/.editorconfig b/.editorconfig index bdc9b52ce69b2..b3084d3f3aa07 100644 --- a/.editorconfig +++ b/.editorconfig @@ -40,6 +40,9 @@ indent_size = 2 [*.ts] indent_size = 2 +[*.tsx] +indent_size = 2 + [*.css] indent_size = 2 diff --git a/.github/workflows/basic-tests.yml b/.github/workflows/basic-tests.yml index 37fa3978c6b79..62ac87721a3a3 100644 --- a/.github/workflows/basic-tests.yml +++ b/.github/workflows/basic-tests.yml @@ -85,7 +85,7 @@ jobs: - run: uv tool run --from apache-airflow-breeze pytest -n auto --color=yes working-directory: ./dev/breeze/ tests-ui: - timeout-minutes: 10 + timeout-minutes: 15 name: React UI tests runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }} if: inputs.run-ui-tests == 'true' @@ -115,7 +115,7 @@ jobs: with: path: airflow/ui/node_modules/ key: cache-ui-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }} - id: restore-eslint-cache + id: restore-eslint-cache-ui - run: cd airflow/ui && pnpm install --frozen-lockfile - run: cd airflow/ui && pnpm test env: @@ -127,7 +127,29 @@ jobs: key: cache-ui-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }} if-no-files-found: 'error' retention-days: '2' - if: steps.restore-eslint-cache.outputs.stash-hit != 'true' + if: steps.restore-eslint-cache-ui.outputs.stash-hit != 'true' + - name: "Restore eslint cache (simple auth manager UI)" + uses: apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468 + with: + path: airflow/auth/managers/simple/ui/node_modules/ + key: > + cache-simple-am-ui-node-modules-v1- + ${{ runner.os }}-${{ hashFiles('airflow/auth/managers/simple/ui/**/pnpm-lock.yaml') }} + id: restore-eslint-cache-simple-am-ui + - run: cd airflow/auth/managers/simple/ui && pnpm install --frozen-lockfile + - run: cd airflow/auth/managers/simple/ui && pnpm test + env: + FORCE_COLOR: 2 + - name: "Save eslint cache (ui)" + uses: apache/infrastructure-actions/stash/save@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468 + with: + path: airflow/auth/managers/simple/ui/node_modules/ + key: > + cache-simple-am-ui-node-modules-v1- + ${{ runner.os }}-${{ hashFiles('airflow/auth/managers/simple/ui/**/pnpm-lock.yaml') }} + if-no-files-found: 'error' + retention-days: '2' + if: steps.restore-eslint-cache-simple-am-ui.outputs.stash-hit != 'true' tests-www: timeout-minutes: 10 diff --git a/airflow/auth/managers/simple/ui/src/test-utils.tsx b/airflow/auth/managers/simple/ui/src/test-utils.tsx index 366492299d1f5..c9428a94452ce 100644 --- a/airflow/auth/managers/simple/ui/src/test-utils.tsx +++ b/airflow/auth/managers/simple/ui/src/test-utils.tsx @@ -18,23 +18,29 @@ */ import React, { PropsWithChildren } from "react"; -import { ChakraProvider } from "@chakra-ui/react"; +import { ChakraProvider, defaultSystem } from "@chakra-ui/react"; import { MemoryRouter, MemoryRouterProps } from "react-router-dom"; -import { QueryClientProvider } from "@tanstack/react-query"; -import { queryClient } from "./queryClient"; +import {QueryClient, QueryClientProvider} from "@tanstack/react-query"; interface WrapperProps extends PropsWithChildren { initialEntries?: MemoryRouterProps["initialEntries"]; } export const Wrapper = ({ initialEntries, children }: WrapperProps) => { + const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: Infinity, + }, + }, + }); return ( - - - - {children} - - + + + + {children} + + ); };