diff --git a/aws_lambda_builders/workflows/go_dep/workflow.py b/aws_lambda_builders/workflows/go_dep/workflow.py index 690f3548f..c2f58ab14 100644 --- a/aws_lambda_builders/workflows/go_dep/workflow.py +++ b/aws_lambda_builders/workflows/go_dep/workflow.py @@ -45,7 +45,7 @@ def __init__(self, **kwargs) options = kwargs["options"] if "options" in kwargs else {} - handler = options.get("handler", None) + handler = options.get("artifact_executable_name", None) if osutils is None: osutils = OSUtils() diff --git a/aws_lambda_builders/workflows/go_modules/workflow.py b/aws_lambda_builders/workflows/go_modules/workflow.py index b19666292..cbfd6d099 100644 --- a/aws_lambda_builders/workflows/go_modules/workflow.py +++ b/aws_lambda_builders/workflows/go_modules/workflow.py @@ -38,7 +38,7 @@ def __init__(self, osutils = OSUtils() options = kwargs.get("options") or {} - handler = options.get("handler", None) + handler = options.get("artifact_executable_name", None) output_path = osutils.joinpath(artifacts_dir, handler) diff --git a/tests/integration/workflows/go_dep/test_go_dep.py b/tests/integration/workflows/go_dep/test_go_dep.py index a379b3d58..e79b63ae2 100644 --- a/tests/integration/workflows/go_dep/test_go_dep.py +++ b/tests/integration/workflows/go_dep/test_go_dep.py @@ -35,7 +35,7 @@ def test_builds_project_with_no_deps(self): self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "Gopkg.toml"), runtime=self.runtime, - options={"handler": "main"}) + options={"artifact_executable_name": "main"}) expected_files = {"main"} output_files = set(os.listdir(self.artifacts_dir)) @@ -49,7 +49,7 @@ def test_builds_project_with_no_gopkg_file(self): self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "Gopkg.toml"), runtime=self.runtime, - options={"handler": "main"}) + options={"artifact_executable_name": "main"}) self.assertEquals( "GoDepBuilder:DepEnsure - Exec Failed: could not find project Gopkg.toml," + @@ -62,7 +62,7 @@ def test_builds_project_with_remote_deps(self): self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "Gopkg.toml"), runtime=self.runtime, - options={"handler": "main"}) + options={"artifact_executable_name": "main"}) expected_files = {"main"} output_files = set(os.listdir(self.artifacts_dir)) @@ -76,7 +76,7 @@ def test_builds_project_with_failed_remote_deps(self): self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "Gopkg.toml"), runtime=self.runtime, - options={"handler": "main"}) + options={"artifact_executable_name": "main"}) # The full message is super long, so part of it is fine. self.assertNotEqual(str(ex.exception).find('unable to deduce repository and source type for'), -1) diff --git a/tests/integration/workflows/go_modules/test_go.py b/tests/integration/workflows/go_modules/test_go.py index 1e138d4a6..a871c7190 100644 --- a/tests/integration/workflows/go_modules/test_go.py +++ b/tests/integration/workflows/go_modules/test_go.py @@ -32,7 +32,7 @@ def test_builds_project_without_dependencies(self): self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "go.mod"), runtime=self.runtime, - options={"handler": "no-deps-main"}) + options={"artifact_executable_name": "no-deps-main"}) expected_files = {"no-deps-main"} output_files = set(os.listdir(self.artifacts_dir)) print(output_files) @@ -43,7 +43,7 @@ def test_builds_project_with_dependencies(self): self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "go.mod"), runtime=self.runtime, - options={"handler": "with-deps-main"}) + options={"artifact_executable_name": "with-deps-main"}) expected_files = {"with-deps-main"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEquals(expected_files, output_files) @@ -54,6 +54,6 @@ def test_fails_if_modules_cannot_resolve_dependencies(self): self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "go.mod"), runtime=self.runtime, - options={"handler": "failed"}) + options={"artifact_executable_name": "failed"}) self.assertIn("GoModulesBuilder:Build - Builder Failed: ", str(ctx.exception)) diff --git a/tests/unit/workflows/go_dep/test_workflow.py b/tests/unit/workflows/go_dep/test_workflow.py index 3b5fcbddc..000e666c0 100644 --- a/tests/unit/workflows/go_dep/test_workflow.py +++ b/tests/unit/workflows/go_dep/test_workflow.py @@ -11,7 +11,11 @@ class TestGoDepWorkflow(TestCase): """ def test_workflow_sets_up_workflow(self): - workflow = GoDepWorkflow("source", "artifacts", "scratch", "manifest", options={"handler": "foo"}) + workflow = GoDepWorkflow("source", + "artifacts", + "scratch", + "manifest", + options={"artifact_executable_name": "foo"}) self.assertEqual(len(workflow.actions), 2) self.assertIsInstance(workflow.actions[0], DepEnsureAction) self.assertIsInstance(workflow.actions[1], GoBuildAction) diff --git a/tests/unit/workflows/go_modules/test_workflow.py b/tests/unit/workflows/go_modules/test_workflow.py index f27fafc05..6a85df8bb 100644 --- a/tests/unit/workflows/go_modules/test_workflow.py +++ b/tests/unit/workflows/go_modules/test_workflow.py @@ -14,6 +14,6 @@ def test_workflow_sets_up_builder_actions(self): workflow = GoModulesWorkflow( "source", "artifacts", "scratch_dir", "manifest", runtime="go1.x", - options={"handler": "main"}) + options={"artifact_executable_name": "main"}) self.assertEqual(len(workflow.actions), 1) self.assertIsInstance(workflow.actions[0], GoModulesBuildAction)