Skip to content

Commit e1a368a

Browse files
Segregate search documents test folders to enable min-max tests (Azure#12643)
1 parent 25f01e4 commit e1a368a

File tree

14 files changed

+27
-15
lines changed

14 files changed

+27
-15
lines changed

sdk/search/search-documents/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"extract-api": "tsc -p . && api-extractor run --local",
2020
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
2121
"integration-test:browser": "karma start --single-run",
22-
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace dist-esm/test/**/*.spec.js --harmony",
22+
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace dist-test/index.node.js --harmony",
2323
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
2424
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
2525
"lint": "eslint package.json api-extractor.json src test --ext .ts -f html -o search-lintReport.html || exit 0",

sdk/search/search-documents/rollup.base.config.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ export function nodeConfig(test = false) {
3636

3737
if (test) {
3838
// Entry points - test files under the `test` folder(common for both browser and node), node specific test files
39-
baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/node/*.spec.js"];
39+
baseConfig.input = [
40+
"dist-esm/test/public/*.spec.js",
41+
"dist-esm/test/internal/*.spec.js",
42+
"dist-esm/test/public/node/*.spec.js",
43+
"dist-esm/test/internal/node/*.spec.js"
44+
];
4045
baseConfig.plugins.unshift(multiEntry({ exports: false }));
4146

4247
// different output file
@@ -94,13 +99,19 @@ export function browserConfig(test = false) {
9499
"@opentelemetry/api": ["CanonicalCode", "SpanKind", "TraceFlags"]
95100
}
96101
}),
102+
// disable the plugin in the rollup config to cut-out errors
97103
viz({ filename: "dist-browser/browser-stats.html", sourcemap: false })
98104
]
99105
};
100106

101107
if (test) {
102108
// Entry points - test files under the `test` folder(common for both browser and node), browser specific test files
103-
baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/browser/*.spec.js"];
109+
baseConfig.input = [
110+
"dist-esm/test/public/*.spec.js",
111+
"dist-esm/test/internal/*.spec.js",
112+
"dist-esm/test/public/browser/*.spec.js",
113+
"dist-esm/test/internal/browser/*.spec.js"
114+
];
104115
baseConfig.plugins.unshift(multiEntry({ exports: false }));
105116
baseConfig.output.file = "dist-test/index.browser.js";
106117

sdk/search/search-documents/test/base64.spec.ts renamed to sdk/search/search-documents/test/internal/base64.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT license.
33

44
import { assert } from "chai";
5-
import { encode, decode } from "../src/base64";
5+
import { encode, decode } from "../../src/base64";
66

77
describe("base64", () => {
88
it("strings can roundtrip", () => {

sdk/search/search-documents/test/geographyPoint.spec.ts renamed to sdk/search/search-documents/test/internal/geographyPoint.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { assert } from "chai";
55
import * as sinon from "sinon";
6-
import GeographyPoint from "../src/geographyPoint";
6+
import GeographyPoint from "../../src/geographyPoint";
77

88
describe("geographyPoint", () => {
99
it("JSON.stringify", () => {

sdk/search/search-documents/test/serialization.spec.ts renamed to sdk/search/search-documents/test/internal/serialization.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import { assert } from "chai";
55
import * as sinon from "sinon";
6-
import { serialize, deserialize } from "../src/serialization";
7-
import GeographyPoint from "../src/geographyPoint";
6+
import { serialize, deserialize } from "../../src/serialization";
7+
import GeographyPoint from "../../src/geographyPoint";
88

99
describe("serialization.serialize", () => {
1010
it("nested", () => {

sdk/search/search-documents/test/tracing.spec.ts renamed to sdk/search/search-documents/test/internal/tracing.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { assert } from "chai";
55
import * as sinon from "sinon";
6-
import { createSpan } from "../src/tracing";
6+
import { createSpan } from "../../src/tracing";
77
import { setTracer, TestTracer, TestSpan } from "@azure/core-tracing";
88
import { SpanKind, TraceFlags } from "@opentelemetry/api";
99
import { OperationOptions } from "@azure/core-http";

sdk/search/search-documents/test/node/searchClient.spec.ts renamed to sdk/search/search-documents/test/public/node/searchClient.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SearchIndexClient,
1414
AutocompleteResult,
1515
IndexDocumentsBatch
16-
} from "../../src/index";
16+
} from "../../../src";
1717
import { Hotel } from "../utils/interfaces";
1818
import { createIndex, populateIndex, WAIT_TIME, createRandomIndexName } from "../utils/setup";
1919
import { delay } from "@azure/core-http";

sdk/search/search-documents/test/node/searchIndexClient.spec.ts renamed to sdk/search/search-documents/test/public/node/searchIndexClient.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/* eslint-disable no-invalid-this */
55
import { isPlaybackMode, record, Recorder, isLiveMode } from "@azure/test-utils-recorder";
66
import { assert } from "chai";
7-
import { SearchIndexClient, SynonymMap, SearchIndex } from "../../src/index";
7+
import { SearchIndexClient, SynonymMap, SearchIndex } from "../../../src";
88
import { Hotel } from "../utils/interfaces";
99
import { createClients, environmentSetup } from "../utils/recordedClient";
1010
import {

sdk/search/search-documents/test/node/searchIndexerClient.spec.ts renamed to sdk/search/search-documents/test/public/node/searchIndexerClient.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
SearchIndexerDataSourceConnection,
1111
SearchIndexerSkillset,
1212
SearchIndexer
13-
} from "../../src/index";
13+
} from "../../../src";
1414
import { Hotel } from "../utils/interfaces";
1515
import { createClients, environmentSetup } from "../utils/recordedClient";
1616
import {

sdk/search/search-documents/test/odata.spec.ts renamed to sdk/search/search-documents/test/public/odata.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { assert } from "chai";
55
import * as sinon from "sinon";
6-
import { odata } from "../src/odata";
6+
import { odata } from "../../src";
77

88
describe("odata", () => {
99
it("simple string isn't changed", () => {

0 commit comments

Comments
 (0)