Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Nancy-Chauhan
Copy link
Contributor

Add tutorial Cloud Integration Testing with LocalStack & GitHub Action

Copy link

github-actions bot commented Apr 30, 2024

🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-1229.surge.sh 🎊

Copy link
Member

@HarshCasper HarshCasper left a 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"
Copy link
Member

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

Comment on lines +8 to +9
teaser: ""
teaser: ""
Copy link
Member

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
Copy link
Member

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

Comment on lines +31 to +35
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)
Copy link
Member

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

Comment on lines +267 to +271
## 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.
Copy link
Member

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.

Comment on lines +84 to +95
**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
```
Copy link
Member

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
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Member

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

Comment on lines +32 to +33
2. [Docker](https://docs.docker.com/engine/install/)
3. [Python-3](https://www.python.org/downloads/)
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants