Skip to content

Commit a7d71bf

Browse files
committed
fix tests and add CHANGELOG
Signed-off-by: ananzh <ananzh@amazon.com>
1 parent fb86582 commit a7d71bf

File tree

3 files changed

+79
-1
lines changed

3 files changed

+79
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
8686
- [Vis Builder] Add persistence to visualizations inner state ([#3751](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3751))
8787
- [Table Visualization] Move format table, consolidate types and add unit tests ([#3397](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3397))
8888
- [Multiple Datasource] Support Amazon OpenSearch Serverless ([#3957](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3957))
89+
- Bundle Node 14 and allow fallback to Node 14 ([#4141](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4141))
90+
8991
### 🐛 Bug Fixes
9092

9193
- [Vis Builder] Fixes auto bounds for timeseries bar chart visualization ([2401](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2401))

src/dev/build/tasks/nodejs/download_node_builds_task.test.ts

+49-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ jest.mock('../../lib/get_build_number');
4444

4545
expect.addSnapshotSerializer(createAnyInstanceSerializer(ToolingLog));
4646

47-
const { getNodeDownloadInfo } = jest.requireMock('./node_download_info');
47+
const { getNodeDownloadInfo, getNodeVersionDownloadInfo } = jest.requireMock(
48+
'./node_download_info'
49+
);
4850
const { getNodeShasums } = jest.requireMock('./node_shasums');
4951
const { download } = jest.requireMock('../../lib/download');
5052

@@ -76,6 +78,16 @@ async function setup({ failOnUrl }: { failOnUrl?: string } = {}) {
7678
};
7779
});
7880

81+
getNodeVersionDownloadInfo.mockImplementation((version, architecture, isWindows, repoRoot) => {
82+
return {
83+
url: `https://mirrors.nodejs.org/dist/v${version}/node-v${version}-${architecture}.tar.gz`,
84+
downloadName: `node-v${version}-${architecture}.tar.gz`,
85+
downloadPath: `/mocked/path/.node_binaries/${version}/node-v${version}-${architecture}.tar.gz`,
86+
extractDir: `/mocked/path/.node_binaries/${version}/${architecture}`,
87+
version,
88+
};
89+
});
90+
7991
getNodeShasums.mockReturnValue({
8092
'linux:downloadName': 'linux:sha256',
8193
'darwin:downloadName': 'darwin:sha256',
@@ -134,6 +146,42 @@ it('downloads node builds for each platform', async () => {
134146
"url": "win32:url",
135147
},
136148
],
149+
Array [
150+
Object {
151+
"destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-linux-x64.tar.gz",
152+
"log": <ToolingLog>,
153+
"retries": 3,
154+
"sha256": undefined,
155+
"url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-linux-x64.tar.gz",
156+
},
157+
],
158+
Array [
159+
Object {
160+
"destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-linux-arm64.tar.gz",
161+
"log": <ToolingLog>,
162+
"retries": 3,
163+
"sha256": undefined,
164+
"url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-linux-arm64.tar.gz",
165+
},
166+
],
167+
Array [
168+
Object {
169+
"destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-darwin-x64.tar.gz",
170+
"log": <ToolingLog>,
171+
"retries": 3,
172+
"sha256": undefined,
173+
"url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-darwin-x64.tar.gz",
174+
},
175+
],
176+
Array [
177+
Object {
178+
"destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-win32-x64.tar.gz",
179+
"log": <ToolingLog>,
180+
"retries": 3,
181+
"sha256": undefined,
182+
"url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-win32-x64.tar.gz",
183+
},
184+
],
137185
]
138186
`);
139187
expect(testWriter.messages).toMatchInlineSnapshot(`Array []`);

src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts

+28
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,27 @@ it('runs expected fs operations', async () => {
123123
"strip": 1,
124124
},
125125
],
126+
Array [
127+
<absolute path>/.node_binaries/14.21.3/node-v14.21.3-linux-x64.tar.gz,
128+
<absolute path>/.node_binaries/14.21.3/linux-x64,
129+
Object {
130+
"strip": 1,
131+
},
132+
],
133+
Array [
134+
<absolute path>/.node_binaries/14.21.3/node-v14.21.3-linux-arm64.tar.gz,
135+
<absolute path>/.node_binaries/14.21.3/linux-arm64,
136+
Object {
137+
"strip": 1,
138+
},
139+
],
140+
Array [
141+
<absolute path>/.node_binaries/14.21.3/node-v14.21.3-darwin-x64.tar.gz,
142+
<absolute path>/.node_binaries/14.21.3/darwin-x64,
143+
Object {
144+
"strip": 1,
145+
},
146+
],
126147
],
127148
"unzip": Array [
128149
Array [
@@ -132,6 +153,13 @@ it('runs expected fs operations', async () => {
132153
"strip": 1,
133154
},
134155
],
156+
Array [
157+
<absolute path>/.node_binaries/14.21.3/node-v14.21.3-win-x64.zip,
158+
<absolute path>/.node_binaries/14.21.3/win32-x64,
159+
Object {
160+
"strip": 1,
161+
},
162+
],
135163
],
136164
}
137165
`);

0 commit comments

Comments
 (0)