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

Tabular extension exec tests #458

Merged
merged 27 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
929b710
Added util to read local test xlsx file to Workbook/Sheet type
f3l1x98 Oct 23, 2023
01ef631
Added tests for cell-range-selector
f3l1x98 Oct 23, 2023
6c264f9
Added fix for 'structuredclone is not defined'
f3l1x98 Oct 23, 2023
f5fe0aa
Added tests for cell-writer
f3l1x98 Oct 23, 2023
f7db0e3
Fixed test names
f3l1x98 Oct 23, 2023
024f6d3
Added missing license files
f3l1x98 Oct 23, 2023
1971864
Added column-deleter tests
f3l1x98 Oct 23, 2023
1e53ac3
Added row-deleter tests
f3l1x98 Oct 23, 2023
7d75217
- Moved file-util into @jvalue/jayvee-execution due to required usage…
f3l1x98 Oct 23, 2023
40b708a
- Added new file-util in @jvalue/jayvee-execution/test containing the…
f3l1x98 Oct 23, 2023
c8f2695
- Moved jsdom-environment-fix.ts from ./src into ./test
f3l1x98 Oct 23, 2023
0550e12
Fixed extractor and loader types
f3l1x98 Oct 23, 2023
a75aeff
Added test for csv-interpreter
f3l1x98 Oct 23, 2023
ea613de
Added tests for sheet-picker-executor
f3l1x98 Oct 23, 2023
affff53
Added missing license file
f3l1x98 Oct 23, 2023
6a59114
Added tests for TableInterpreterExecutor
f3l1x98 Oct 30, 2023
031a4d3
Added missing license file
f3l1x98 Oct 30, 2023
11257eb
Added tests for TableTransformExecutor
f3l1x98 Oct 30, 2023
81941d7
Added tests for XLSXInterpreterExecutor
f3l1x98 Oct 30, 2023
aa99e18
removed unnecessary test file
f3l1x98 Oct 30, 2023
2240655
Added missing export of interface
f3l1x98 Oct 30, 2023
f941c08
Added tests for TableInterpreterExecutor with empty columns input
f3l1x98 Oct 30, 2023
ae9d2da
Merge remote-tracking branch 'origin/main' into feature/tabular-exten…
f3l1x98 Nov 13, 2023
9290f97
Fixed merge
f3l1x98 Nov 13, 2023
078c4a9
Applied new TestExtension loading
f3l1x98 Nov 13, 2023
f8456af
Merge remote-tracking branch 'origin/main' into feature/tabular-exten…
f3l1x98 Nov 13, 2023
f9b2918
Adjusted tests to table rowCount bugfix
f3l1x98 Nov 13, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0-only

import { FileExtension, MimeType } from '@jvalue/jayvee-execution';
import { FileExtension, MimeType } from '../types';

import {
inferFileExtensionFromContentTypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
//
// SPDX-License-Identifier: AGPL-3.0-only

import { FileExtension, MimeType } from '@jvalue/jayvee-execution';
import * as mime from 'mime-types';

import { FileExtension, MimeType } from '../types';

export function inferMimeTypeFromFileExtensionString(
fileExtension: string | undefined,
): MimeType | undefined {
Expand Down
2 changes: 2 additions & 0 deletions libs/execution/src/lib/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
// SPDX-License-Identifier: AGPL-3.0-only

export * from './implements-static-decorator';
export * from './file-util';
export * from './string-util';
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ import {
FileExtension,
MimeType,
TextFile,
} from '@jvalue/jayvee-execution';

import {
inferFileExtensionFromFileExtensionString,
inferMimeTypeFromFileExtensionString,
} from '../src/file-util';
import { splitLines } from '../src/string-util';
splitLines,
} from '../../src';

export function createBinaryFileFromLocalFile(fileName: string): BinaryFile {
const extName = path.extname(fileName);
Expand Down
6 changes: 6 additions & 0 deletions libs/execution/test/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg
//
// SPDX-License-Identifier: AGPL-3.0-only

export * from './test-infrastructure-util';
export * from './file-util';
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
TableColumn,
blockExecutorRegistry,
constraintExecutorRegistry,
} from '../src';
} from '../../src';

export function clearBlockExecutorRegistry() {
blockExecutorRegistry.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import {
createBinaryFileFromLocalFile,
getTestExecutionContext,
} from '@jvalue/jayvee-execution/test';
import {
BlockDefinition,
IOType,
Expand All @@ -21,8 +24,6 @@ import {
import { AstNode, AstNodeLocator, LangiumDocument } from 'langium';
import { NodeFileSystem } from 'langium/node';

import { createBinaryFileFromLocalFile } from '../test';

import { ArchiveInterpreterExecutor } from './archive-interpreter-executor';

describe('Validation of ArchiveInterpreterExecutor', () => {
Expand Down
7 changes: 2 additions & 5 deletions libs/extensions/std/exec/src/archive-interpreter-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ import {
MimeType,
err,
implementsStatic,
inferFileExtensionFromFileExtensionString,
inferMimeTypeFromFileExtensionString,
} from '@jvalue/jayvee-execution';
import { IOType, PrimitiveValuetypes } from '@jvalue/jayvee-language-server';
import * as JSZip from 'jszip';

import {
inferFileExtensionFromFileExtensionString,
inferMimeTypeFromFileExtensionString,
} from './file-util';

@implementsStatic<BlockExecutorClass>()
export class ArchiveInterpreterExecutor extends AbstractBlockExecutor<
IOType.FILE,
Expand Down
7 changes: 4 additions & 3 deletions libs/extensions/std/exec/src/file-picker-executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import {
createBinaryFileFromLocalFile,
getTestExecutionContext,
} from '@jvalue/jayvee-execution/test';
import {
BlockDefinition,
IOType,
Expand All @@ -21,8 +24,6 @@ import {
import { AstNode, AstNodeLocator, LangiumDocument } from 'langium';
import { NodeFileSystem } from 'langium/node';

import { createBinaryFileFromLocalFile } from '../test';

import { FilePickerExecutor } from './file-picker-executor';

describe('Validation of FilePickerExecutor', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import {
createBinaryFileFromLocalFile,
getTestExecutionContext,
} from '@jvalue/jayvee-execution/test';
import {
BlockDefinition,
IOType,
Expand All @@ -21,8 +24,6 @@ import {
import { AstNode, AstNodeLocator, LangiumDocument } from 'langium';
import { NodeFileSystem } from 'langium/node';

import { createBinaryFileFromLocalFile } from '../test';

import { GtfsRTInterpreterExecutor } from './gtfs-rt-interpreter-executor';

describe('Validation of GtfsRTInterpreterExecutor', () => {
Expand Down
8 changes: 3 additions & 5 deletions libs/extensions/std/exec/src/http-extractor-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ import {
MimeType,
None,
implementsStatic,
inferFileExtensionFromContentTypeString,
inferFileExtensionFromFileExtensionString,
inferMimeTypeFromFileExtensionString,
} from '@jvalue/jayvee-execution';
import { IOType, PrimitiveValuetypes } from '@jvalue/jayvee-language-server';
import { http, https } from 'follow-redirects';
import { AstNode } from 'langium';

import {
inferFileExtensionFromContentTypeString,
inferFileExtensionFromFileExtensionString,
inferMimeTypeFromFileExtensionString,
} from './file-util';
import {
createBackoffStrategy,
isBackoffStrategyHandle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import {
createBinaryFileFromLocalFile,
getTestExecutionContext,
} from '@jvalue/jayvee-execution/test';
import {
BlockDefinition,
IOType,
Expand All @@ -21,8 +24,6 @@ import {
import { AstNode, AstNodeLocator, LangiumDocument } from 'langium';
import { NodeFileSystem } from 'langium/node';

import { createBinaryFileFromLocalFile } from '../test';

import { TextFileInterpreterExecutor } from './text-file-interpreter-executor';

describe('Validation of TextFileInterpreterExecutor', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import {
ExecutionContext,
TextFile,
implementsStatic,
splitLines,
} from '@jvalue/jayvee-execution';
import { IOType, PrimitiveValuetypes } from '@jvalue/jayvee-language-server';

import { splitLines } from './string-util';

@implementsStatic<BlockExecutorClass>()
export class TextFileInterpreterExecutor extends AbstractBlockExecutor<
IOType.FILE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import {
createTextFileFromLocalFile,
getTestExecutionContext,
} from '@jvalue/jayvee-execution/test';
import {
BlockDefinition,
IOType,
Expand All @@ -21,8 +24,6 @@ import {
import { AstNode, AstNodeLocator, LangiumDocument } from 'langium';
import { NodeFileSystem } from 'langium/node';

import { createTextFileFromLocalFile } from '../test';

import { TextLineDeleterExecutor } from './text-line-deleter-executor';

describe('Validation of TextLineDeleterExecutor', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import {
createTextFileFromLocalFile,
getTestExecutionContext,
} from '@jvalue/jayvee-execution/test';
import {
BlockDefinition,
IOType,
Expand All @@ -21,8 +24,6 @@ import {
import { AstNode, AstNodeLocator, LangiumDocument } from 'langium';
import { NodeFileSystem } from 'langium/node';

import { createTextFileFromLocalFile } from '../test';

import { TextRangeSelectorExecutor } from './text-range-selector-executor';

describe('Validation of TextRangeSelectorExecutor', () => {
Expand Down
1 change: 0 additions & 1 deletion libs/extensions/std/exec/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
// SPDX-License-Identifier: AGPL-3.0-only

export * from './mocks';
export * from './utils';
1 change: 1 addition & 0 deletions libs/extensions/tabular/exec/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
export default {
displayName: 'extensions-tabular-exec',
preset: '../../../../jest.preset.js',
testEnvironment: './test/jsdom-environment-fix.ts',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
Expand Down
Loading
Loading