Skip to content

Commit

Permalink
ci: fix canary failures (#4511)
Browse files Browse the repository at this point in the history
* fix terraform test checks

* fix terraform local test expected output

* add dateparser to the list of hidden imports

* print build error from container

* run package tests in parallel

* fix log formatting

* run delete tests in 4 parallel threads
  • Loading branch information
mndeveci authored Dec 22, 2022
1 parent b343eef commit bce85fd
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions appveyor-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ for:

test_script:
- "pip install -e \".[dev]\""
- sh: "pytest -vv tests/integration/package --json-report --json-report-file=TEST_REPORT-integration-package.json"
- sh: "pytest -vv tests/integration/package -n 4 --reruns 4 --json-report --json-report-file=TEST_REPORT-integration-package.json"

# Integ testing delete
-
Expand All @@ -296,7 +296,7 @@ for:

test_script:
- "pip install -e \".[dev]\""
- sh: "pytest -vv tests/integration/delete --json-report --json-report-file=TEST_REPORT-integration-delete.json"
- sh: "pytest -vv tests/integration/delete -n 4 --reruns 4 --json-report --json-report-file=TEST_REPORT-integration-delete.json"

# Integ testing sync
-
Expand Down
4 changes: 2 additions & 2 deletions appveyor-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ for:
- "git --version"
- "venv\\Scripts\\activate"
- "docker system prune -a -f"
- ps: "pytest -vv tests/integration/package --json-report --json-report-file=TEST_REPORT-integration-package.json"
- ps: "pytest -vv tests/integration/package -n 4 --reruns 4 --json-report --json-report-file=TEST_REPORT-integration-package.json"

# Integ testing delete
- matrix:
Expand All @@ -239,7 +239,7 @@ for:
- "git --version"
- "venv\\Scripts\\activate"
- "docker system prune -a -f"
- ps: "pytest -vv tests/integration/delete --json-report --json-report-file=TEST_REPORT-integration-delete.json"
- ps: "pytest -vv tests/integration/delete -n 4 --reruns 4 --json-report --json-report-file=TEST_REPORT-integration-delete.json"

# Integ testing sync
- matrix:
Expand Down
1 change: 1 addition & 0 deletions samcli/cli/hidden_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ def walk_modules(module: HasPathAndName, visited: set) -> None:
"pkg_resources.py2_warn",
"aws_lambda_builders.workflows",
"configparser",
"dateparser",
]
2 changes: 1 addition & 1 deletion samcli/lib/build/app_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ def _parse_builder_response(stdout_data: str, image_name: str) -> Dict:
except Exception:
# Invalid JSON is produced as an output only when the builder process crashed for some reason.
# Report this as a crash
LOG.debug("Builder crashed")
LOG.error("Builder crashed: %s", stdout_data)
raise

if "error" in response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def test_build_and_invoke_lambda_functions(self, function_identifier, expected_o
f"https://aws.amazon.com/service-terms/.{os.linesep}"
)
self.assertNotRegex(stdout.decode("utf-8"), terraform_beta_feature_prompted_text)
self.assertTrue(stderr.decode("utf-8").startswith(Colored().yellow(experimental_warning)))
self.assertIn(Colored().yellow(experimental_warning), stderr.decode("utf-8"))
LOG.info("sam build stdout: %s", stdout.decode("utf-8"))
LOG.info("sam build stderr: %s", stderr.decode("utf-8"))
self.assertEqual(return_code, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def setUp(self):

@pytest.mark.flaky(reruns=3)
def test_invoke_function_and_warning_message_is_printed(self):
self.assertTrue(self.start_lambda_process_error.startswith(Colored().yellow(EXPERIMENTAL_WARNING)))
self.assertIn(Colored().yellow(EXPERIMENTAL_WARNING), self.start_lambda_process_error)


class TestLocalStartLambdaTerraformApplicationWithExperimentalPromptNo(StartLambdaTerraformApplicationIntegBase):
Expand Down

0 comments on commit bce85fd

Please sign in to comment.