From f8127932f392ffeb8d631d87008db0db9c108c44 Mon Sep 17 00:00:00 2001 From: Andrea Culot <95755271+andclt@users.noreply.github.com> Date: Wed, 11 Oct 2023 18:33:43 +0100 Subject: [PATCH] Add nodejs20.x support (#67) * Add nodejs20.x support * fix: Fix missing encoding when logging from Makefile (#535) * Fix missing encoding when logging from Makefile * Add comment explaining why stderr * Undo testing code * Version bump to 1.37.0 (#537) * Support PEP 600 platform tags for arm64 (#536) Co-authored-by: Daniel Mil <84205762+mildaniel@users.noreply.github.com> * chore(deps-dev): bump ruff from 0.0.284 to 0.0.287 in /requirements (#539) Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.284 to 0.0.287. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.0.284...v0.0.287) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump actions/checkout from 3 to 4 (#538) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump black from 23.3.0 to 23.7.0 in /requirements (#534) * chore(deps-dev): bump black from 23.3.0 to 23.7.0 in /requirements Bumps [black](https://github.com/psf/black) from 23.3.0 to 23.7.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.3.0...23.7.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update requirements/dev.txt --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> * chore(deps-dev): bump black from 23.7.0 to 23.9.1 in /requirements (#543) Bumps [black](https://github.com/psf/black) from 23.7.0 to 23.9.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.7.0...23.9.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump ruff from 0.0.287 to 0.0.288 in /requirements (#542) Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.287 to 0.0.288. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.0.287...v0.0.288) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): update pyelftools requirement in /requirements (#540) Updates the requirements on [pyelftools](https://github.com/eliben/pyelftools) to permit the latest version. - [Changelog](https://github.com/eliben/pyelftools/blob/master/CHANGES) - [Commits](https://github.com/eliben/pyelftools/compare/v0.29...v0.30) --- updated-dependencies: - dependency-name: pyelftools dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump coverage from 7.2.7 to 7.3.1 in /requirements (#541) * chore(deps-dev): bump coverage from 7.2.7 to 7.3.1 in /requirements Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.7 to 7.3.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.2.7...7.3.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * fix: set coverage versions based on python versions - since coverage 7.3.x python3.7 support has been dropped. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sriram Madapusi Vasudevan Co-authored-by: Sriram Madapusi Vasudevan <3770774+sriram-mv@users.noreply.github.com> * chore: Version Bump 1.38.0 (#544) * chore(deps-dev): bump ruff from 0.0.288 to 0.0.290 in /requirements (#545) Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.288 to 0.0.290. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.0.288...v0.0.290) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update github action to install nodejs 20 --------- Signed-off-by: dependabot[bot] Co-authored-by: Lucas <12496191+lucashuy@users.noreply.github.com> Co-authored-by: Daniel Mil <84205762+mildaniel@users.noreply.github.com> Co-authored-by: jack-davies Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> Co-authored-by: Sriram Madapusi Vasudevan Co-authored-by: Sriram Madapusi Vasudevan <3770774+sriram-mv@users.noreply.github.com> Co-authored-by: Mohamed Elasmar <71043312+moelasmar@users.noreply.github.com> Co-authored-by: Mohamed ElAsmar --- .github/workflows/build.yml | 26 +++++++------- .github/workflows/codeql.yml | 2 +- aws_lambda_builders/__init__.py | 2 +- aws_lambda_builders/validator.py | 1 + .../workflows/custom_make/make.py | 13 +++++-- .../workflows/python_pip/packager.py | 1 + requirements/dev.txt | 10 +++--- .../workflows/nodejs_npm/test_nodejs_npm.py | 33 +++++++++-------- .../test_nodejs_npm_with_esbuild.py | 36 +++++++++---------- 9 files changed, 70 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb11eb9f2..083a9d2f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,7 +66,7 @@ jobs: - "3.9" - "3.10" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -94,13 +94,13 @@ jobs: - 8 - 9 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 - if: ${{ matrix.npm }} run: npm install -g npm@${{ matrix.npm }} - run: npm --version @@ -127,13 +127,13 @@ jobs: - 8 - 9 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 - if: ${{ matrix.npm }} run: npm install -g npm@${{ matrix.npm }} - run: npm --version @@ -157,7 +157,7 @@ jobs: - "3.10" - "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -184,7 +184,7 @@ jobs: - "3.10" - "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -214,7 +214,7 @@ jobs: - "3.10" - "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -242,7 +242,7 @@ jobs: - "3.10" - "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -266,7 +266,7 @@ jobs: - "3.10" - "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -290,7 +290,7 @@ jobs: - "3.10" - "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -320,7 +320,7 @@ jobs: - "3.10" - "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -349,7 +349,7 @@ jobs: rust: - stable steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 098f6ee0f..2bca1e9d3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/aws_lambda_builders/__init__.py b/aws_lambda_builders/__init__.py index 1af77605e..b23d6eaab 100644 --- a/aws_lambda_builders/__init__.py +++ b/aws_lambda_builders/__init__.py @@ -4,5 +4,5 @@ # Changing version will trigger a new release! # Please make the version change as the last step of your development. -__version__ = "1.36.0" +__version__ = "1.38.0" RPC_PROTOCOL_VERSION = "0.3" diff --git a/aws_lambda_builders/validator.py b/aws_lambda_builders/validator.py index c09d19275..534068e22 100644 --- a/aws_lambda_builders/validator.py +++ b/aws_lambda_builders/validator.py @@ -14,6 +14,7 @@ "nodejs14.x": [ARM64, X86_64], "nodejs16.x": [ARM64, X86_64], "nodejs18.x": [ARM64, X86_64], + "nodejs20.x": [ARM64, X86_64], "python3.7": [X86_64], "python3.8": [ARM64, X86_64], "python3.9": [ARM64, X86_64], diff --git a/aws_lambda_builders/workflows/custom_make/make.py b/aws_lambda_builders/workflows/custom_make/make.py index 974fdbd9d..799242b04 100644 --- a/aws_lambda_builders/workflows/custom_make/make.py +++ b/aws_lambda_builders/workflows/custom_make/make.py @@ -4,6 +4,7 @@ import io import logging import shutil +import sys import threading LOG = logging.getLogger(__name__) @@ -92,9 +93,17 @@ def run(self, args, env=None, cwd=None): # Log every stdout line by iterating for line in p.stdout: - decoded_line = line.decode("utf-8").strip() - LOG.info(decoded_line) + # Writing to stderr instead of using LOG.info + # since the logger library does not include ANSI + # formatting characters in the output + # + # stderr is used since stdout appears to be reserved + # for command responses + sys.stderr.buffer.write(line) + sys.stderr.flush() + # Gather total stdout + decoded_line = line.decode("utf-8").strip() stdout += decoded_line # Wait for the process to exit and stderr thread to end. diff --git a/aws_lambda_builders/workflows/python_pip/packager.py b/aws_lambda_builders/workflows/python_pip/packager.py index 4a33732f0..372868d03 100644 --- a/aws_lambda_builders/workflows/python_pip/packager.py +++ b/aws_lambda_builders/workflows/python_pip/packager.py @@ -193,6 +193,7 @@ class DependencyBuilder(object): _MANYLINUX_LEGACY_MAP = { "manylinux1_x86_64": "manylinux_2_5_x86_64", "manylinux2010_x86_64": "manylinux_2_12_x86_64", + "manylinux2014_aarch64": "manylinux_2_17_aarch64", "manylinux2014_x86_64": "manylinux_2_17_x86_64", } diff --git a/requirements/dev.txt b/requirements/dev.txt index 2e81f158c..6710e19e7 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,5 @@ -coverage==7.2.7 +coverage==7.2.7; python_version < '3.8' +coverage==7.3.1; python_version >= '3.8' flake8==3.3.0; python_version < '3.8' flake8==3.8.4; python_version >= '3.8' pytest-cov==4.1.0 @@ -8,8 +9,9 @@ isort>=4.2.5,<5; python_version < '3.8' # Test requirements pytest>=6.1.1 parameterized==0.9.0 -pyelftools~=0.29 # Used to verify the generated Go binary architecture in integration tests (utils.py) +pyelftools~=0.30 # Used to verify the generated Go binary architecture in integration tests (utils.py) # formatter -black==23.3.0 -ruff==0.0.284 \ No newline at end of file +black==22.6.0; python_version < "3.8" +black==23.9.1; python_version >= "3.8" +ruff==0.0.290 \ No newline at end of file diff --git a/tests/integration/workflows/nodejs_npm/test_nodejs_npm.py b/tests/integration/workflows/nodejs_npm/test_nodejs_npm.py index f6a755dd7..e34e66d90 100644 --- a/tests/integration/workflows/nodejs_npm/test_nodejs_npm.py +++ b/tests/integration/workflows/nodejs_npm/test_nodejs_npm.py @@ -41,7 +41,7 @@ def tearDown(self): shutil.rmtree(self.dependencies_dir) shutil.rmtree(self.temp_dir) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_without_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps") @@ -57,7 +57,7 @@ def test_builds_project_without_dependencies(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_without_manifest(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-manifest") @@ -75,7 +75,7 @@ def test_builds_project_without_manifest(self, runtime): mock_warning.assert_called_once_with("package.json file not found. Continuing the build without dependencies.") self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_and_excludes_hidden_aws_sam(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "excluded-files") @@ -91,7 +91,7 @@ def test_builds_project_and_excludes_hidden_aws_sam(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_with_remote_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps") @@ -111,7 +111,7 @@ def test_builds_project_with_remote_dependencies(self, runtime): output_modules = set(os.listdir(os.path.join(self.artifacts_dir, "node_modules"))) self.assertEqual(expected_modules, output_modules) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_with_npmrc(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "npmrc") @@ -138,14 +138,17 @@ def test_builds_project_with_npmrc(self, runtime): ("nodejs14.x", "package-lock"), ("nodejs16.x", "package-lock"), ("nodejs18.x", "package-lock"), + ("nodejs20.x", "package-lock"), ("nodejs12.x", "shrinkwrap"), ("nodejs14.x", "shrinkwrap"), ("nodejs16.x", "shrinkwrap"), ("nodejs18.x", "shrinkwrap"), + ("nodejs20.x", "shrinkwrap"), ("nodejs12.x", "package-lock-and-shrinkwrap"), ("nodejs14.x", "package-lock-and-shrinkwrap"), ("nodejs16.x", "package-lock-and-shrinkwrap"), ("nodejs18.x", "package-lock-and-shrinkwrap"), + ("nodejs20.x", "package-lock-and-shrinkwrap"), ] ) def test_builds_project_with_lockfile(self, runtime, dir_name): @@ -172,7 +175,7 @@ def test_builds_project_with_lockfile(self, runtime, dir_name): self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_fails_if_npm_cannot_resolve_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "broken-deps") @@ -187,7 +190,7 @@ def test_fails_if_npm_cannot_resolve_dependencies(self, runtime): self.assertIn("No matching version found for aws-sdk@2.997.999", str(ctx.exception)) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_with_remote_dependencies_without_download_dependencies_with_dependencies_dir(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps") @@ -205,7 +208,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_with_remote_dependencies_with_download_dependencies_and_dependencies_dir(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps") @@ -235,7 +238,7 @@ def test_builds_project_with_remote_dependencies_with_download_dependencies_and_ output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir))) self.assertNotIn(expected_dependencies_files, output_dependencies_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_with_remote_dependencies_without_download_dependencies_without_dependencies_dir( self, runtime ): @@ -256,7 +259,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_without_combine_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps") @@ -283,7 +286,7 @@ def test_builds_project_without_combine_dependencies(self, runtime): output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir))) self.assertNotIn(expected_dependencies_files, output_dependencies_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_build_in_source_with_download_dependencies(self, runtime): source_dir = os.path.join(self.temp_testdata_dir, "npm-deps") @@ -312,7 +315,7 @@ def test_build_in_source_with_download_dependencies(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_build_in_source_with_download_dependencies_local_dependency(self, runtime): source_dir = os.path.join(self.temp_testdata_dir, "with-local-dependency") @@ -341,7 +344,7 @@ def test_build_in_source_with_download_dependencies_local_dependency(self, runti output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_build_in_source_with_download_dependencies_and_dependencies_dir(self, runtime): source_dir = os.path.join(self.temp_testdata_dir, "npm-deps") @@ -376,7 +379,7 @@ def test_build_in_source_with_download_dependencies_and_dependencies_dir(self, r output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_build_in_source_with_download_dependencies_and_dependencies_dir_without_combine_dependencies( self, runtime ): @@ -409,7 +412,7 @@ def test_build_in_source_with_download_dependencies_and_dependencies_dir_without output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_build_in_source_reuse_saved_dependencies_dir(self, runtime): source_dir = os.path.join(self.temp_testdata_dir, "npm-deps") diff --git a/tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py b/tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py index 35b877d9c..ecd6119b8 100644 --- a/tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py +++ b/tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py @@ -52,7 +52,7 @@ def tearDown(self): if os.path.exists(source_dependencies): shutil.rmtree(source_dependencies) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_javascript_project_with_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild") @@ -73,7 +73,7 @@ def test_builds_javascript_project_with_dependencies(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_javascript_project_with_multiple_entrypoints(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-multiple-entrypoints") @@ -94,7 +94,7 @@ def test_builds_javascript_project_with_multiple_entrypoints(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_typescript_projects(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-typescript") @@ -115,7 +115,7 @@ def test_builds_typescript_projects(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_with_external_esbuild(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps-esbuild") options = {"entry_points": ["included.js"]} @@ -135,7 +135,7 @@ def test_builds_with_external_esbuild(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_no_options_passed_to_esbuild(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild") @@ -152,7 +152,7 @@ def test_no_options_passed_to_esbuild(self, runtime): self.assertEqual(str(context.exception), "NodejsNpmEsbuildBuilder:EsbuildBundle - entry_points not set ({})") - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_bundle_with_implicit_file_types(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "implicit-file-types") @@ -173,7 +173,7 @@ def test_bundle_with_implicit_file_types(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_bundles_project_without_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-package-esbuild") options = {"entry_points": ["included"]} @@ -199,7 +199,7 @@ def test_bundles_project_without_dependencies(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_with_remote_dependencies_without_download_dependencies_with_dependencies_dir(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules") options = {"entry_points": ["included.js"]} @@ -227,7 +227,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_with_remote_dependencies_with_download_dependencies_and_dependencies_dir(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules") options = {"entry_points": ["included.js"]} @@ -257,7 +257,7 @@ def test_builds_project_with_remote_dependencies_with_download_dependencies_and_ output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir))) self.assertNotIn(expected_dependencies_files, output_dependencies_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_with_remote_dependencies_without_download_dependencies_without_dependencies_dir( self, runtime ): @@ -282,7 +282,7 @@ def test_builds_project_with_remote_dependencies_without_download_dependencies_w "dependencies directory was not provided and downloading dependencies is disabled.", ) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_project_without_combine_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules") options = {"entry_points": ["included.js"]} @@ -313,7 +313,7 @@ def test_builds_project_without_combine_dependencies(self, runtime): output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir))) self.assertNotIn(expected_dependencies_files, output_dependencies_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_javascript_project_with_external(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-externals") @@ -338,7 +338,7 @@ def test_builds_javascript_project_with_external(self, runtime): # Check that the module has been require() instead of bundled self.assertIn('require("minimal-request-promise")', js_file) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_builds_javascript_project_with_loader(self, runtime): osutils = OSUtils() source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps-esbuild-loader") @@ -380,7 +380,7 @@ def test_builds_javascript_project_with_loader(self, runtime): ), ) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_includes_sourcemap_if_requested(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild") @@ -401,7 +401,7 @@ def test_includes_sourcemap_if_requested(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_esbuild_produces_mjs_output_files(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild") options = {"entry_points": ["included.js"], "sourcemap": True, "out_extension": [".js=.mjs"]} @@ -421,7 +421,7 @@ def test_esbuild_produces_mjs_output_files(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_esbuild_produces_sourcemap_without_source_contents(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild") options = {"entry_points": ["included.js"], "sourcemap": True, "sources_content": "false"} @@ -444,7 +444,7 @@ def test_esbuild_produces_sourcemap_without_source_contents(self, runtime): self.assertNotIn("sourcesContent", sourcemap) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_esbuild_can_build_in_source(self, runtime): options = {"entry_points": ["included.js"]} @@ -470,7 +470,7 @@ def test_esbuild_can_build_in_source(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",)]) + @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) def test_esbuild_can_build_in_source_with_local_dependency(self, runtime): self.source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-local-dependency")