Skip to content

Commit

Permalink
test: exclude parquet-tools when running on M1
Browse files Browse the repository at this point in the history
it fails with
```
    org.xerial.snappy.SnappyError: [FAILED_TO_LOAD_NATIVE_LIBRARY] no native library is found for os.name=Mac and os.arch=aarch64
```
  • Loading branch information
dvirtz committed Oct 22, 2023
1 parent 2095487 commit 8227c90
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"languageId": "git",
"ignoreRegExpList": [
"/#\\s.*/", // comments
"/`.*?`/" // inline code
"/`.*?`/", // inline code
"/(```+)\\s?[\\s\\S]+?\\1/g" // code block
]
}
]
Expand Down
24 changes: 16 additions & 8 deletions test/integration/parquet-editor-provider.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { afterEach, beforeEach, describe, expect, jest, test } from '@jest/globals';
import os from 'os';
import * as path from 'path';
import * as vscode from 'vscode';
import { BackendName } from '../../src/backend-name';
import { initLogger } from '../../src/logger';
import { ParquetTextDocumentContentProvider } from "../../src/parquet-document-provider";
import { ParquetEditorProvider } from "../../src/parquet-editor-provider";
import * as settings from '../../src/settings';
import { getUri, readFile } from "./utils";
import { BackendName } from '../../src/backend-name';

jest.setTimeout(60000);

Expand Down Expand Up @@ -54,13 +55,20 @@ describe('ParquetEditorProvider', function () {
return uri;
}

test.each<[string, BackendName]>([
['small', 'parquet-tools'],
['small', 'parquets'],
['small', 'arrow'],
['large', 'parquets'],
['version_2', 'arrow']
])('shows %p using %p', async function (name, backend) {
const tests = (() => {
const tests: [string, BackendName][] = [
['small', 'parquets'],
['small', 'arrow'],
['large', 'parquets'],
['version_2', 'arrow']
];
if (os.type() != 'Darwin' || os.arch() == 'x64') {
return tests.concat([['small', 'parquet-tools']]);
}
return tests;
})();

test.each(tests)('shows %p using %p', async function (name, backend) {
const parquet = await getUri(`${name}.parquet`);
testFile = await copyTo(`${name}-${backend}.parquet`, parquet);
const checkChanged = new Promise((resolve, reject) => {
Expand Down
7 changes: 5 additions & 2 deletions test/unit/backend.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import toArray from '@async-generators/to-array';
import { afterEach, describe, expect, jest, test } from '@jest/globals';
import { createReadStream } from 'fs';
import os from 'os';
import * as path from 'path';
import { createInterface } from 'readline';
import * as vscode from 'vscode';
import { CancellationToken } from 'vscode';
import { BackendNames } from '../../src/backend-name';
import { createParquetBackend } from '../../src/parquet-backend-factory';
import * as vscode from 'vscode';
import { workspace } from './workspace';

jest.setTimeout(60000);

describe.each(BackendNames)("%s backend tests", (backendName) => {
// parquet-tools doesn't work on Apple M1
const backends = BackendNames.filter(backend => os.type() != 'Darwin' || os.arch() == 'x64' || backend != 'parquet-tools');
describe.each(backends)("%s backend tests", (backendName) => {
const backend = createParquetBackend(backendName);

const testFiles = {
Expand Down

0 comments on commit 8227c90

Please sign in to comment.