Skip to content

Commit

Permalink
Test/binary canaries (#5711)
Browse files Browse the repository at this point in the history
* chore: Update CFN Lint version to support python 3.11 (#5651)

* Update CFN Lint version to support python 3.11

* Run make update-reproducible-reqs

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* fix: Require file label to run before maintainers (#5656)

* Require file label to run before maintainers

* Run maintainer label job even if previous job fails

* Add Windows config

* Fix formatting

* Update config

* test

* Update config

* Update config

* Update config

* Update config

* chore: update aws_lambda_builders to 1.36.0 (#5655)

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>

* Update config

* Update config

* fix(invoke): Write in UTF-8 string instead of bytes (#5642)

* Revert "fix: Revert UTF-8 fixes #5485 and #5427 (#5512)"

This reverts commit 36f8bf9.

* Enforce utf8 on stdout/stderr/logfile

---------

Co-authored-by: Jacob Fuss <[email protected]>

* chore(deps): bump cryptography from 41.0.2 to 41.0.3 in /requirements (#5675)

Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.2 to 41.0.3.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@41.0.2...41.0.3)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add linux config

* fix(test): Force reading file with utf8 in tests for windows (#5679)

Co-authored-by: Jacob Fuss <[email protected]>

* fix(test): Increase max execution time for timeout tests (#5680)

Co-authored-by: Jacob Fuss <[email protected]>

* Update install links

* Update linux config

* Update linux config

* Update linux config

* Update linux config

* Update linux config

* Update linux config

* Update linux config

* Update linux config

* Update linux config

* Update linux config

* Update linux config

* chore: auto update reproducible requirements when there is a dependency change (#5677)

* chore: add reproducible gha

* format

* formatting v2

* format v3

* use win make target

* update windows job

* update win paths

* why windows why

* remove if stmt for now

* test with direct paths

* update windows paths again

* bring back activate

* add dummy win file and push changes

* update base.txt for testing

* Update reproducibles

* run jobs sequentially

* print changed flag

* check changes again

* run git status before moving forward

* refresh index before checking any changed files

* Update reproducibles

* commit or skip

* Update reproducibles

* rerun build & pyinstaller jobs once update reproducible finishes

* add more details to commit message

* nuke all reproducibles to trigger the CI

* Update reproducibles: update-reproducible-linux-reqs

* Update reproducibles: update-reproducible-mac-reqs

* Update reproducibles: update-reproducible-win-reqs

* change lb version for testing

* update permissions and limit only for aws/aws-sam-cli

* Update reproducibles: update-reproducible-linux-reqs

* Update reproducibles: update-reproducible-mac-reqs

* Update reproducibles: update-reproducible-win-reqs

* update other jobs as well

* run without file filter

* Update reproducibles: update-reproducible-linux-reqs

* Update reproducibles: update-reproducible-mac-reqs

* Update reproducibles: update-reproducible-win-reqs

* put the file filter back

---------

Co-authored-by: GitHub Action <[email protected]>

* fix: Repair failing integration test (#5698)

* Fix failing integration test

* Be more specific with error message

---------

Co-authored-by: Leonardo Gama <[email protected]>

* Update Windows config

* fix: link the API gateway resource parent to either rest api or another gateway resource (#5697)

* Update Windows config

* Update Windows config

* Update Windows config

* Update Windows config

* Update Windows config

* Update Windows config

* Update Windows config

* Update Windows config

* Revert "Test/binary canaries (#5706)"

This reverts commit 8a9e0c9.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Connor Kirkpatrick <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mehmet Nuri Deveci <[email protected]>
Co-authored-by: Leonardo Gama <[email protected]>
Co-authored-by: Leonardo Gama <[email protected]>
  • Loading branch information
12 people authored Aug 3, 2023
1 parent 902e947 commit a7b76a2
Show file tree
Hide file tree
Showing 23 changed files with 129 additions and 291 deletions.
132 changes: 0 additions & 132 deletions tests/iac_integration/cdk/test_sam_cdk_integration.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def setUp(self):
shutil.copytree(Path(self.terraform_application_path), Path(self.working_dir))

def run_command(self, command_list, env=None, input=None):
process = Popen(command_list, stdout=PIPE, stderr=PIPE, stdin=PIPE, env=env, cwd=self.working_dir, shell=True)
process = Popen(command_list, stdout=PIPE, stderr=PIPE, stdin=PIPE, env=env, cwd=self.working_dir)
try:
(stdout, stderr) = process.communicate(input=input)
return stdout, stderr, process.returncode
Expand Down
45 changes: 10 additions & 35 deletions tests/integration/init/test_init_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def test_init_command_passes_and_dir_created(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -83,8 +82,7 @@ def test_init_command_passes_and_dir_created_image(self):
"--no-interactive",
"-o",
temp,
],
shell = True,
]
)
try:
process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -115,7 +113,6 @@ def test_init_new_app_template(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -148,7 +145,6 @@ def test_init_command_java_maven(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -181,7 +177,6 @@ def test_init_command_java_gradle(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -214,7 +209,6 @@ def test_init_command_go_provided_image(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -249,7 +243,6 @@ def test_init_command_with_extra_context_parameter(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -284,7 +277,6 @@ def test_init_command_passes_with_arm_architecture(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -319,7 +311,6 @@ def test_init_command_passes_with_x86_64_architecture(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -351,8 +342,7 @@ def test_init_command_passes_with_unknown_architecture(self):
temp,
"--architecture",
"unknown_arch",
],
shell=True,
]
)
capture_output = ""
try:
Expand Down Expand Up @@ -384,8 +374,7 @@ def test_init_command_passes_with_enabled_tracing(self):
"-o",
temp,
"--tracing",
],
shell=True,
]
)
try:
process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -415,8 +404,7 @@ def test_init_command_passes_with_disabled_tracing(self):
"-o",
temp,
"--no-tracing",
],
shell=True,
]
)
try:
process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -446,8 +434,7 @@ def test_init_command_passes_with_enabled_application_insights(self):
"-o",
temp,
"--application-insights",
],
shell=True,
]
)
try:
process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -477,8 +464,7 @@ def test_init_command_passes_with_disabled_application_insights(self):
"-o",
temp,
"--no-application-insights",
],
shell=True,
]
)
try:
process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -538,7 +524,6 @@ def test_init_command_no_interactive_missing_name(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -568,7 +553,6 @@ def test_init_command_no_interactive_apptemplate_location(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -601,7 +585,6 @@ def test_init_command_no_interactive_runtime_location(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -633,7 +616,6 @@ def test_init_command_no_interactive_base_image_location(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -666,7 +648,6 @@ def test_init_command_no_interactive_base_image_no_dependency(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -696,7 +677,6 @@ def test_init_command_no_interactive_packagetype_location(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -727,7 +707,6 @@ def test_init_command_no_interactive_base_image_no_packagetype(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand All @@ -754,7 +733,6 @@ def test_init_command_wrong_packagetype(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -807,7 +785,7 @@ def test_arbitrary_project(self, project_name):
if project_name:
args.extend(["--name", project_name])

process = Popen(args, shell=True,)
process = Popen(args)
try:
process.communicate(timeout=TIMEOUT)
except TimeoutExpired:
Expand All @@ -823,7 +801,7 @@ def test_zip_not_exists(self):
with tempfile.TemporaryDirectory() as temp:
args = [get_sam_command(), "init", "--location", str(Path("invalid", "zip", "path")), "-o", temp]

process = Popen(args, shell=True,)
process = Popen(args)
try:
process.communicate(timeout=TIMEOUT)
except TimeoutExpired:
Expand All @@ -847,7 +825,7 @@ def test_location_with_no_interactive_and_name(self):
"-o",
tmp,
]
process = Popen(args, shell=True,)
process = Popen(args)

try:
process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -959,7 +937,6 @@ def _run_init(self, cwd):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -1000,7 +977,6 @@ def test_zip_template_config(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -1036,7 +1012,6 @@ def test_image_template_config(self):
],
stdout=PIPE,
stderr=PIPE,
shell=True,
)
try:
stdout_data, stderr_data = process.communicate(timeout=TIMEOUT)
Expand Down Expand Up @@ -1097,7 +1072,7 @@ class TestInitCommand(InitIntegBase):
def test_graceful_exit(self):
# Run the Base Command
command_list = self.get_command()
process_execute = Popen(command_list, stdout=PIPE, stderr=PIPE, shell=True,)
process_execute = Popen(command_list, stdout=PIPE, stderr=PIPE)

# Wait for binary to be ready before sending interrupts.
time.sleep(self.BINARY_READY_WAIT_TIME)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/local/generate_event/test_cli_integ.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

class Test_EventGeneration_Integ(TestCase):
def test_generate_event_substitution(self):
process = Popen([get_sam_command(), "local", "generate-event", "s3", "put"], shell=True,)
process = Popen([get_sam_command(), "local", "generate-event", "s3", "put"])
process.communicate()
self.assertEqual(process.returncode, 0)
Loading

0 comments on commit a7b76a2

Please sign in to comment.