From 69a19ad5d27124c416ecd84a938434f9e5526ab1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:36:07 -0800 Subject: [PATCH 1/7] chore(deps-dev): bump pytest-cov from 5.0.0 to 6.0.0 in /requirements (#698) * chore(deps-dev): bump pytest-cov from 5.0.0 to 6.0.0 in /requirements Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 5.0.0 to 6.0.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v5.0.0...v6.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Pin pytest-cov versions based on the python version --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --- requirements/dev.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 696612142..58b84823c 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,7 +1,8 @@ coverage==7.6.4; python_version>="3.9" coverage==7.6.1; python_version<"3.9" flake8==3.8.4 -pytest-cov==5.0.0 +pytest-cov==6.0.0; python_version>="3.9" +pytest-cov==5.0.0; python_version<"3.9" # Test requirements pytest>=6.1.1 From 2b1aee123386030e8b6d969d5ab5c48af271afd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:03:15 -0800 Subject: [PATCH 2/7] chore(deps-dev): bump ruff from 0.7.1 to 0.7.3 in /requirements (#702) Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.1 to 0.7.3. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.7.1...0.7.3) --- 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> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 58b84823c..6aa7c6a50 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -12,4 +12,4 @@ pyelftools~=0.31 # Used to verify the generated Go binary architecture in integr # formatter black==24.10.0; python_version>="3.9" black==24.8.0; python_version<"3.9" -ruff==0.7.1 +ruff==0.7.3 From 2a2d6b72fae684efd379f19e7a0149715bcc4a33 Mon Sep 17 00:00:00 2001 From: Jeffry Angtoni Date: Sat, 16 Nov 2024 05:15:44 +0700 Subject: [PATCH 3/7] Fix: Support JVM version string from old (< v8.9) and new (>= v8.9) gradle version (#683) * fix(validator): support version string from old and newest gradle * fix(test): fix unit test * test: add more version and runtime to the test * refactor(validator): use full label instead * fix(validator): use in operator to check JVM substring --------- Co-authored-by: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> --- .../workflows/java_gradle/gradle_validator.py | 2 +- .../java_gradle/test_gradle_validator.py | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/aws_lambda_builders/workflows/java_gradle/gradle_validator.py b/aws_lambda_builders/workflows/java_gradle/gradle_validator.py index 2972e75b2..5107b9c2d 100644 --- a/aws_lambda_builders/workflows/java_gradle/gradle_validator.py +++ b/aws_lambda_builders/workflows/java_gradle/gradle_validator.py @@ -83,5 +83,5 @@ def _get_jvm_string(self, gradle_path): for line in stdout.splitlines(): l_dec = decode(line) - if l_dec.startswith("JVM"): + if "JVM" in l_dec: return l_dec diff --git a/tests/unit/workflows/java_gradle/test_gradle_validator.py b/tests/unit/workflows/java_gradle/test_gradle_validator.py index 2815b4f68..f51bf5c9f 100644 --- a/tests/unit/workflows/java_gradle/test_gradle_validator.py +++ b/tests/unit/workflows/java_gradle/test_gradle_validator.py @@ -78,6 +78,40 @@ def test_emits_warning_when_version_string_not_found(self): validator.validate(runtime_path=self.runtime_path) self.mock_log.warning.assert_called_with(GradleValidator.VERSION_STRING_WARNING, self.runtime_path) + @parameterized.expand( + [ + ("1.8.0", "java8"), + ("11.0.0", "java11"), + ("17.0.0", "java17"), + ("21.0.0", "java21"), + ] + ) + def test_does_not_emit_warning_for_version_string_in_gradle_lt_8_9(self, version, runtime): + version_string = f"JVM: {version}".encode() + self.mock_os_utils.popen.side_effect = [FakePopen(stdout=version_string, returncode=0)] + validator = GradleValidator( + runtime=runtime, architecture=self.architecture, os_utils=self.mock_os_utils, log=self.mock_log + ) + validator.validate(runtime_path=self.runtime_path) + self.mock_log.warning.assert_not_called() + + @parameterized.expand( + [ + ("1.8.0", "java8"), + ("11.0.0", "java11"), + ("17.0.0", "java17"), + ("21.0.0", "java21"), + ] + ) + def test_does_not_emit_warning_for_version_string_in_gradle_ge_8_9(self, version, runtime): + version_string = f"Launcher JVM: {version}".encode() + self.mock_os_utils.popen.side_effect = [FakePopen(stdout=version_string, returncode=0)] + validator = GradleValidator( + runtime=runtime, architecture=self.architecture, os_utils=self.mock_os_utils, log=self.mock_log + ) + validator.validate(runtime_path=self.runtime_path) + self.mock_log.warning.assert_not_called() + @parameterized.expand( [ ("11.0.0", "java11"), From 1d437f744398a0407ccc0477903d678c83bffe7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:40:39 -0800 Subject: [PATCH 4/7] chore(deps-dev): bump ruff from 0.7.3 to 0.7.4 in /requirements (#704) Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.3 to 0.7.4. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.7.3...0.7.4) --- 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> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 6aa7c6a50..1c4004e1b 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -12,4 +12,4 @@ pyelftools~=0.31 # Used to verify the generated Go binary architecture in integr # formatter black==24.10.0; python_version>="3.9" black==24.8.0; python_version<"3.9" -ruff==0.7.3 +ruff==0.7.4 From 53b009e87539bcb87124858d1f3215a322cd93d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:40:43 -0800 Subject: [PATCH 5/7] chore(deps-dev): bump coverage from 7.6.4 to 7.6.7 in /requirements (#703) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.4 to 7.6.7. - [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.6.4...7.6.7) --- updated-dependencies: - dependency-name: coverage 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> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 1c4004e1b..e74301d2e 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,4 @@ -coverage==7.6.4; python_version>="3.9" +coverage==7.6.7; python_version>="3.9" coverage==7.6.1; python_version<"3.9" flake8==3.8.4 pytest-cov==6.0.0; python_version>="3.9" From ce09b96916f25717a963b40746e3bf9a88d67cb7 Mon Sep 17 00:00:00 2001 From: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:57:23 -0800 Subject: [PATCH 6/7] feat: Add nodejs22.x support (#696) * feat: Add nodejs22.x support * Add missing comma to integ test --- .github/workflows/build.yml | 4 +- aws_lambda_builders/validator.py | 1 + .../workflows/nodejs_npm/test_nodejs_npm.py | 49 ++++++++++--------- .../test_nodejs_npm_with_esbuild.py | 46 ++++++++--------- 4 files changed, 52 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 763ff55a4..2a1e9ad0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,7 +100,7 @@ jobs: python-version: ${{ matrix.python }} - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 - if: ${{ matrix.npm }} run: npm install -g npm@${{ matrix.npm }} - run: npm --version @@ -134,7 +134,7 @@ jobs: python-version: ${{ matrix.python }} - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 - if: ${{ matrix.npm }} run: npm install -g npm@${{ matrix.npm }} - run: npm --version diff --git a/aws_lambda_builders/validator.py b/aws_lambda_builders/validator.py index adee8d7ec..d66f7293f 100644 --- a/aws_lambda_builders/validator.py +++ b/aws_lambda_builders/validator.py @@ -13,6 +13,7 @@ "nodejs16.x": [ARM64, X86_64], "nodejs18.x": [ARM64, X86_64], "nodejs20.x": [ARM64, X86_64], + "nodejs22.x": [ARM64, X86_64], "python3.8": [ARM64, X86_64], "python3.9": [ARM64, X86_64], "python3.10": [ARM64, X86_64], diff --git a/tests/integration/workflows/nodejs_npm/test_nodejs_npm.py b/tests/integration/workflows/nodejs_npm/test_nodejs_npm.py index d27f8a2d6..bfb7f0ecb 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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_without_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps") @@ -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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_with_npmrc(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "npmrc") @@ -137,12 +137,15 @@ def test_builds_project_with_npmrc(self, runtime): ("nodejs16.x", "package-lock"), ("nodejs18.x", "package-lock"), ("nodejs20.x", "package-lock"), + ("nodejs22.x", "package-lock"), ("nodejs16.x", "shrinkwrap"), ("nodejs18.x", "shrinkwrap"), ("nodejs20.x", "shrinkwrap"), + ("nodejs22.x", "shrinkwrap"), ("nodejs16.x", "package-lock-and-shrinkwrap"), ("nodejs18.x", "package-lock-and-shrinkwrap"), ("nodejs20.x", "package-lock-and-shrinkwrap"), + ("nodejs22.x", "package-lock-and-shrinkwrap"), ] ) def test_builds_project_with_lockfile(self, runtime, dir_name): @@ -169,7 +172,7 @@ def test_builds_project_with_lockfile(self, runtime, dir_name): self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_fails_if_npm_cannot_resolve_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "broken-deps") @@ -184,7 +187,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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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") @@ -202,7 +205,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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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") @@ -232,7 +235,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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_with_remote_dependencies_without_download_dependencies_without_dependencies_dir( self, runtime ): @@ -253,7 +256,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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_without_combine_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "npm-deps") @@ -280,7 +283,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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_build_in_source_with_download_dependencies(self, runtime): source_dir = os.path.join(self.temp_testdata_dir, "npm-deps") @@ -309,7 +312,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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_build_in_source_with_removed_dependencies(self, runtime): # run a build with default requirements and confirm dependencies are downloaded source_dir = os.path.join(self.temp_testdata_dir, "npm-deps") @@ -349,7 +352,7 @@ def test_build_in_source_with_removed_dependencies(self, runtime): self.assertIn(".package-lock.json", set(os.listdir(source_node_modules))) self.assertNotIn("minimal-request-promise", set(os.listdir(source_node_modules))) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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") @@ -378,7 +381,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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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") @@ -413,7 +416,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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_build_in_source_with_download_dependencies_and_dependencies_dir_without_combine_dependencies( self, runtime ): @@ -446,7 +449,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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_build_in_source_reuse_saved_dependencies_dir(self, runtime): source_dir = os.path.join(self.temp_testdata_dir, "npm-deps") @@ -502,7 +505,7 @@ def test_build_in_source_reuse_saved_dependencies_dir(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_with_manifest_outside_root(self, runtime): base_dir = os.path.join(self.temp_testdata_dir, "manifest-outside-root") source_dir = os.path.join(base_dir, "src") @@ -525,7 +528,7 @@ def test_builds_project_with_manifest_outside_root(self, runtime): output_modules = set(os.listdir(os.path.join(self.artifacts_dir, "node_modules"))) self.assertEqual(expected_modules, output_modules) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_with_manifest_outside_root_with_reuse_saved_dependencies_dir(self, runtime): base_dir = os.path.join(self.temp_testdata_dir, "manifest-outside-root") source_dir = os.path.join(base_dir, "src") @@ -572,7 +575,7 @@ def test_builds_project_with_manifest_outside_root_with_reuse_saved_dependencies output_modules = set(os.listdir(os.path.join(self.artifacts_dir, "node_modules"))) self.assertEqual(expected_modules, output_modules) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_with_manifest_outside_root_with_dependencies_dir_and_not_combine(self, runtime): base_dir = os.path.join(self.temp_testdata_dir, "manifest-outside-root") source_dir = os.path.join(base_dir, "src") @@ -597,7 +600,7 @@ def test_builds_project_with_manifest_outside_root_with_dependencies_dir_and_not dependencies_dir_modules = set(os.listdir(os.path.join(self.dependencies_dir, "node_modules"))) self.assertEqual(expected_modules, dependencies_dir_modules) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_with_manifest_outside_root_with_dependencies_dir_and_combine(self, runtime): base_dir = os.path.join(self.temp_testdata_dir, "manifest-outside-root") source_dir = os.path.join(base_dir, "src") @@ -626,7 +629,7 @@ def test_builds_project_with_manifest_outside_root_with_dependencies_dir_and_com dependencies_dir_modules = set(os.listdir(os.path.join(self.dependencies_dir, "node_modules"))) self.assertEqual(expected_modules, dependencies_dir_modules) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_with_manifest_outside_root_and_local_dependencies(self, runtime): base_dir = os.path.join(self.temp_testdata_dir, "manifest-outside-root-with-local-dependency") source_dir = os.path.join(base_dir, "src") @@ -654,7 +657,7 @@ def test_builds_project_with_manifest_outside_root_and_local_dependencies(self, source_modules = set(os.listdir(os.path.join(source_dir, "node_modules"))) self.assertTrue(all(expected_module in source_modules for expected_module in expected_modules)) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_with_manifest_outside_root_and_local_dependencies_with_reuse_saved_dependencies_dir( self, runtime ): @@ -709,7 +712,7 @@ def test_builds_project_with_manifest_outside_root_and_local_dependencies_with_r source_modules = set(os.listdir(os.path.join(source_dir, "node_modules"))) self.assertTrue(all(expected_module in source_modules for expected_module in expected_modules)) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_with_manifest_outside_root_and_local_dependencies_with_dependencies_dir_and_not_combine( self, runtime ): @@ -741,7 +744,7 @@ def test_builds_project_with_manifest_outside_root_and_local_dependencies_with_d source_modules = set(os.listdir(os.path.join(source_dir, "node_modules"))) self.assertTrue(all(expected_module in source_modules for expected_module in expected_modules)) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_project_with_manifest_outside_root_and_local_dependencies_with_dependencies_dir_and_combine( self, runtime ): 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 81f832da4..4a759f13b 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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.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") @@ -498,7 +498,7 @@ def test_esbuild_can_build_in_source_with_local_dependency(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_javascript_project_ignoring_relevant_flags(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild") @@ -519,7 +519,7 @@ def test_builds_javascript_project_ignoring_relevant_flags(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_typescript_projects_with_external_manifest(self, runtime): base_dir = os.path.join(self.TEST_DATA_FOLDER, "esbuild-manifest-outside-root") source_dir = os.path.join(base_dir, "src") @@ -541,7 +541,7 @@ def test_builds_typescript_projects_with_external_manifest(self, runtime): output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_typescript_projects_with_external_manifest_with_dependencies_dir_without_combine(self, runtime): base_dir = os.path.join(self.TEST_DATA_FOLDER, "esbuild-manifest-outside-root") source_dir = os.path.join(base_dir, "src") @@ -570,7 +570,7 @@ def test_builds_typescript_projects_with_external_manifest_with_dependencies_dir output_modules = set(os.listdir(os.path.join(self.dependencies_dir, "node_modules"))) self.assertIn(expected_modules, output_modules) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_typescript_projects_with_external_manifest_with_dependencies_dir_with_combine(self, runtime): base_dir = os.path.join(self.TEST_DATA_FOLDER, "esbuild-manifest-outside-root") source_dir = os.path.join(base_dir, "src") @@ -599,7 +599,7 @@ def test_builds_typescript_projects_with_external_manifest_with_dependencies_dir output_modules = set(os.listdir(os.path.join(self.dependencies_dir, "node_modules"))) self.assertIn(expected_modules, output_modules) - @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",)]) + @parameterized.expand([("nodejs16.x",), ("nodejs18.x",), ("nodejs20.x",), ("nodejs22.x",)]) def test_builds_typescript_projects_with_external_manifest_and_local_depends(self, runtime): base_dir = os.path.join(self.temp_testdata_dir, "esbuild-manifest-outside-root-with-local-depends") source_dir = os.path.join(base_dir, "src") From 5c8dae85d4078cdd18782afc0d3b2247844bae9b Mon Sep 17 00:00:00 2001 From: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:31:26 -0800 Subject: [PATCH 7/7] chore: version bump to 1.52.0 (#705) --- aws_lambda_builders/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws_lambda_builders/__init__.py b/aws_lambda_builders/__init__.py index 60a006248..6c3c410f1 100644 --- a/aws_lambda_builders/__init__.py +++ b/aws_lambda_builders/__init__.py @@ -5,5 +5,5 @@ # Changing version will trigger a new release! # Please make the version change as the last step of your development. -__version__ = "1.51.0" +__version__ = "1.52.0" RPC_PROTOCOL_VERSION = "0.3"