-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tutorial Cloud Integration Testing with LocalStack & GitHub Action #1229
base: main
Are you sure you want to change the base?
Conversation
🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-1229.surge.sh 🎊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Round 1
@@ -0,0 +1,282 @@ | |||
--- | |||
title: "Cloud Integration Testing with LocalStack & GitHub Action" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub Actions is the official product name
teaser: "" | ||
teaser: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there two teaser fields? I would also suggest to link the apt teaser here
teaser: "" | ||
services: | ||
- S3 | ||
- lambda |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this sample uses way more services than that
1. LocalStack Pro with [LocalStack Auth Token](https://docs.localstack.cloud/getting-started/auth-token/) | ||
2. [Docker](https://docs.docker.com/engine/install/) | ||
3. [Python-3](https://www.python.org/downloads/) | ||
4. [LocalStack web application account](https://app.localstack.cloud/sign-in) | ||
5. [GitHub account](https://github.com/) & [`gh` CLI](https://github.com/cli/cli?tab=readme-ov-file#installation) (optional) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use pointers instead of numbers
## Best practice for LocalStack and CI | ||
|
||
**Streamline State Management:** Instead of reinventing the wheel with manual state scripting, consider utilizing existing tools such as [LocalStack SAM](https://docs.localstack.cloud/user-guide/integrations/aws-sam/) for serverless applications. | ||
|
||
**Leverage Cloud Pods Effectively:** LocalStack's [Cloud Pods](https://docs.localstack.cloud/user-guide/state-management/) offer a valuable optimization technique. By pre-populating your LocalStack environment with specific data sets or configurations, you can significantly reduce setup time during CI runs and also maintain consistency across CI runs, ensuring efficient test execution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to leave these out, since it goes beyond the scope of this tutorial and we'll have future content centred around these.
**Step 2: Docker setup (macOS only)** | ||
|
||
For macOS environments, this step installs `docker` and starts [`colima`](https://github.com/abiosoft/colima) (Container runtimes on macOS (and Linux) with minimal setup), which could be necessary for certain development or testing scenarios. | ||
|
||
```yaml | ||
- name: Docker setup (macOS only) | ||
id: setup-docker-mac | ||
if: ${{ runner.os == 'macOS' }} | ||
run: | | ||
brew install docker | ||
colima start | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be added as a note rather than a step
AWS_ACCESS_KEY_ID: test | ||
AWS_SECRET_ACCESS_KEY: test | ||
run: | | ||
pytest tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just pytest
should suffice here
|
||
**Step 10: Upload the Diagnostic Report** | ||
|
||
Upon failure of any step of the workflow, this action uploads the generated diagnostic report as an artifact, making it accessible for review and troubleshooting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon failure of any step of the workflow, this action uploads the generated diagnostic report as an artifact, making it accessible for review and troubleshooting. | |
Upon failure of any step of the workflow, this action uploads the generated diagnostic report as an artifact, making it accessible for review and troubleshooting. |
|
||
## Introduction | ||
|
||
Building and maintaining applications that interact with AWS services can be a challenge. Testing these integrations in a reliable and efficient manner is crucial for ensuring smooth operation. This tutroial introduces a powerful combination: LocalStack and GitHub Actions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the intro should be more expansive and discuss greater ideas, such as
- how running tests on CI against AWS can be time-consuming
- how transient faults can lead to flaky tests
- how testing directly on AWS can be expensive, especially while dealing with exotic services
2. [Docker](https://docs.docker.com/engine/install/) | ||
3. [Python-3](https://www.python.org/downloads/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I read Prerequisites
, I take it as something I need to configure on my machine. In this particular tutorial, that does not appear to be the case.
Add tutorial Cloud Integration Testing with LocalStack & GitHub Action