Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(ci): fix UI test beds and dependency cache invalidation (#7902)

白熱36a095de8fd0
diff --git a/common/shared/eslint/rules.ts b/common/shared/eslint/rules.ts
index e317dc6883..fd46d01ac2 100644
--- a/common/shared/eslint/rules.ts
+++ b/common/shared/eslint/rules.ts
@@ -116,7 +116,21 @@ const importRules: Partial<Rules> = {
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
- 'perfectionist/sort-imports': 'warn',
+ 'perfectionist/sort-imports': ['warn', {
+ groups: [
+ ['type-builtin', 'type-external'],
+ ['value-builtin', 'value-external'],
+ 'type-internal',
+ 'value-internal',
+ ['type-parent', 'type-sibling', 'type-index'],
+ ['value-parent', 'value-sibling', 'value-index'],
+ 'side-effect',
+ 'ts-equals-import',
+ 'unknown',
+ ],
+ newlinesBetween: 0,
+ newlinesInside: 0,
+ }],
'perfectionist/sort-named-imports': 'off',
'perfectionist/sort-named-exports': 'warn',
diff --git a/packages/sheets-conditional-formatting-ui/src/__tests__/create-cf-ui-test-bed.ts b/packages/sheets-conditional-formatting-ui/src/__tests__/create-cf-ui-test-bed.ts
index 46bc0b25cb..d4544ff22a 100644
--- a/packages/sheets-conditional-formatting-ui/src/__tests__/create-cf-ui-test-bed.ts
+++ b/packages/sheets-conditional-formatting-ui/src/__tests__/create-cf-ui-test-bed.ts
@@ -42,6 +42,7 @@ import {
RemoveOtherFormulaMutation,
SetOtherFormulaMutation,
} from '@univerjs/engine-formula';
+import { CanvasColorService, ICanvasColorService } from '@univerjs/engine-render';
import {
BorderStyleManagerService,
RangeProtectionRuleModel,
@@ -319,6 +320,7 @@ export function createCfUiTestBed() {
const commandService = get(ICommandService);
const selectionsService = get(SheetsSelectionsService);
+ injector.add([ICanvasColorService, { useClass: CanvasColorService }]);
injector.add([IActiveDirtyManagerService, { useClass: ActiveDirtyManagerService }]);
injector.add([RegisterOtherFormulaService]);
injector.add([ConditionalFormattingRuleModel]);
diff --git a/packages/sheets-data-validation-ui/src/views/components/__tests__/DataValidationDetail.spec.tsx b/packages/sheets-data-validation-ui/src/views/components/__tests__/DataValidationDetail.spec.tsx
index 6f24865241..a337e1d2d7 100644
--- a/packages/sheets-data-validation-ui/src/views/components/__tests__/DataValidationDetail.spec.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/__tests__/DataValidationDetail.spec.tsx
@@ -61,7 +61,7 @@ import {
SheetRowFilteredService,
SuperTableService,
} from '@univerjs/engine-formula';
-import { IRenderManagerService } from '@univerjs/engine-render';
+import { CanvasColorService, ICanvasColorService, IRenderManagerService } from '@univerjs/engine-render';
import {
RangeProtectionRuleModel,
RefRangeService,
@@ -422,6 +422,7 @@ function createDetailTestBed(rule: ISheetDataValidationRule) {
[IDialogService, { useClass: TestDialogService }],
[IEditorService, { useClass: TestEditorService }],
[IDescriptionService, { useClass: TestDescriptionService }],
+ [ICanvasColorService, { useClass: CanvasColorService }],
[IRenderManagerService, { useClass: TestRenderManagerService as never }],
[IPlatformService, { useClass: PlatformService }],
[IUIRuntimeScopeService, { useClass: UIRuntimeScopeService }],
diff --git a/packages/sheets-data-validation-ui/src/views/components/__tests__/DataValidationItem.spec.tsx b/packages/sheets-data-validation-ui/src/views/components/__tests__/DataValidationItem.spec.tsx
index f0ceac466e..bbe25fd53d 100644
--- a/packages/sheets-data-validation-ui/src/views/components/__tests__/DataValidationItem.spec.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/__tests__/DataValidationItem.spec.tsx
@@ -65,7 +65,7 @@ import {
SheetRowFilteredService,
SuperTableService,
} from '@univerjs/engine-formula';
-import { IRenderManagerService } from '@univerjs/engine-render';
+import { CanvasColorService, ICanvasColorService, IRenderManagerService } from '@univerjs/engine-render';
import {
RangeProtectionRuleModel,
RefRangeService,
@@ -388,6 +388,7 @@ function createItemTestBed(rule: ISheetDataValidationRule = createCheckboxRule()
[ComponentManager],
[IEditorService, { useClass: TestEditorService }],
[IDescriptionService, { useClass: TestDescriptionService }],
+ [ICanvasColorService, { useClass: CanvasColorService }],
[IRenderManagerService, { useClass: TestRenderManagerService as never }],
[IPlatformService, { useClass: PlatformService }],
[IUIRuntimeScopeService, { useClass: UIRuntimeScopeService }],
diff --git a/packages/sheets-table-ui/src/views/components/__tests__/SheetTableComponents.spec.tsx b/packages/sheets-table-ui/src/views/components/__tests__/SheetTableComponents.spec.tsx
index 23eedc5c21..17f55b007d 100644
--- a/packages/sheets-table-ui/src/views/components/__tests__/SheetTableComponents.spec.tsx
+++ b/packages/sheets-table-ui/src/views/components/__tests__/SheetTableComponents.spec.tsx
@@ -16,7 +16,6 @@
import type { Dependency, IDisposable, IDocumentData, IWorkbookData, Workbook } from '@univerjs/core';
import type { Root } from 'react-dom/client';
-import type { IConditionInfo } from '../type';
import {
createIdentifier,
ICommandService,
@@ -33,7 +32,7 @@ import {
UniverInstanceType,
} from '@univerjs/core';
import { DefinedNamesService, FormulaDataModel, IDefinedNamesService, LexerTreeBuilder } from '@univerjs/engine-formula';
-import { IRenderManagerService } from '@univerjs/engine-render';
+import { CanvasColorService, ICanvasColorService, IRenderManagerService } from '@univerjs/engine-render';
import {
AddRangeThemeMutation,
RemoveRangeThemeMutation,
@@ -72,6 +71,7 @@ import { act, useState } from 'react';
import { createRoot } from 'react-dom/client';
import { Subject } from 'rxjs';
import { afterEach, describe, expect, it, vi } from 'vitest';
+import type { IConditionInfo } from '../type';
import { SheetsTableMobileComponentController } from '../../../controllers/mobile/sheet-table-component.controller';
import { SheetsTableComponentController } from '../../../controllers/sheet-table-component.controller';
import { SheetTableThemeUIController } from '../../../controllers/sheet-table-theme-ui.controller';
@@ -487,6 +487,7 @@ function createTestBed(): ITestBed {
[SheetInterceptorService],
[SheetSkeletonService, { useClass: SheetSkeletonService }],
[SheetsSelectionsService],
+ [ICanvasColorService, { useClass: CanvasColorService }],
[IRenderManagerService, { useClass: TestRenderManagerService }],
[IEditorService, { useClass: TestEditorService as never }],
[IMarkSelectionService, { useClass: TestMarkSelectionService as never }],
diff --git a/turbo.json b/turbo.json
index 6027289e75..a22d99314a 100644
--- a/turbo.json
+++ b/turbo.json
@@ -1,10 +1,16 @@
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
+ "transit": {
+ "dependsOn": ["^transit"]
+ },
+
"test": {
+ "dependsOn": ["transit"]
},
"coverage": {
+ "dependsOn": ["transit"],
"outputs": ["coverage/**"],
"env": ["CI"]
},