Skip to content

Commit

Permalink
Merge branch 'develop' into version-bump-1.52
Browse files Browse the repository at this point in the history
  • Loading branch information
hnnasit authored Nov 20, 2024
2 parents c877cf1 + ce09b96 commit 297e641
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions aws_lambda_builders/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
49 changes: 26 additions & 23 deletions tests/integration/workflows/nodejs_npm/test_nodejs_npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand All @@ -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):
Expand All @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand Down Expand Up @@ -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
):
Expand All @@ -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")

Expand All @@ -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")

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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
):
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
):
Expand Down Expand Up @@ -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
):
Expand Down Expand Up @@ -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
):
Expand Down
Loading

0 comments on commit 297e641

Please sign in to comment.