From 5fc48a939ee78d49df03a493b872bfef758f17a6 Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Mon, 4 Mar 2024 15:41:10 -0500 Subject: [PATCH] Feat: Add script to update the required extension version --- integration-tests/src/runTest.ts | 5 +++-- integration-tests/src/utils/version.ts | 8 ++++++++ scripts/update-extension-version.sh | 28 ++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 integration-tests/src/utils/version.ts create mode 100644 scripts/update-extension-version.sh diff --git a/integration-tests/src/runTest.ts b/integration-tests/src/runTest.ts index a2ec5dde..05ac7cd7 100644 --- a/integration-tests/src/runTest.ts +++ b/integration-tests/src/runTest.ts @@ -10,6 +10,7 @@ import { resolveCliArgsFromVSCodeExecutablePath, runTests } from '@vscode/test-electron' +import { pythonVersion, bashVersion } from './utils/version' async function main (): Promise { try { @@ -20,8 +21,8 @@ async function main (): Promise { cliPath, [ ...args, - '--install-extension', 'mads-hartmann.bash-ide-vscode@1.39.0', - '--install-extension', 'ms-python.python@2023.20.0' + '--install-extension', `mads-hartmann.bash-ide-vscode@${bashVersion}`, + '--install-extension', `ms-python.python@${pythonVersion}` ], { encoding: 'utf-8', diff --git a/integration-tests/src/utils/version.ts b/integration-tests/src/utils/version.ts new file mode 100644 index 00000000..153ace0b --- /dev/null +++ b/integration-tests/src/utils/version.ts @@ -0,0 +1,8 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) 2023 Savoir-faire Linux. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +// Required extension versions +export const bashVersion = '1.39.0' +export const pythonVersion = '2024.2.1' diff --git a/scripts/update-extension-version.sh b/scripts/update-extension-version.sh new file mode 100644 index 00000000..b265e880 --- /dev/null +++ b/scripts/update-extension-version.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -e + +DEST="integration-tests/src/utils/version.ts" + +# Keep the header +TOTAL_LINES=$(wc -l < $DEST) +LINES_TO_KEEP=$(($TOTAL_LINES - 2)) +TMP="tmp.ts" +head -n $LINES_TO_KEEP $DEST > $TMP + +git clone --depth 1 --filter=blob:none --sparse https://github.com/bash-lsp/bash-language-server +cd bash-language-server +git fetch --tags +echo "export const bashVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^vscode-client-//")'" >> ../$TMP +cd .. +rm -rf bash-language-server + +git clone --depth 1 --filter=blob:none --sparse https://github.com/Microsoft/vscode-python +cd vscode-python +git fetch --tags +echo "export const pythonVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^v//")'" >> ../$TMP +cd .. +rm -rf vscode-python + +cp $TMP $DEST +rm $TMP \ No newline at end of file