Skip to content

Commit

Permalink
[cds-902] Integration Testing (#6)
Browse files Browse the repository at this point in the history
* updated dependencies

* moved internal logic to lib.rs

* initial commit for integration tests

* removed unused imports

* added comments to test macro

* udpate s3 event

* changelog

* changelog

* add bad code

* bad code

* updated dependencies

* refactored integration tests

* Added mock s3 client and removed the need to call aws apis. Add local
test files, refactored tests

* added formatting

* dependencies

* moved s3 key decoding into s3 handler function directly

* moved s3 key decoding

* added test_s3_event_handler

* move test_handle_s3_event to unit test

* add tests workflow

* add tag step
  • Loading branch information
daidokoro authored Dec 22, 2023
1 parent 9e98196 commit 657ac57
Show file tree
Hide file tree
Showing 14 changed files with 1,094 additions and 175 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
branches:
- master
- dev
paths:
- 'template.yaml'

workflow_dispatch:

Expand Down Expand Up @@ -33,6 +34,7 @@ jobs:
set -xv
# Extract the value from the current commit
current=$(yq '.Metadata."AWS::ServerlessRepo::Application".SemanticVersion' template.yaml)
echo "current_version=$current" >> $GITHUB_ENV
# Extract the value from the previous commit
git checkout HEAD^ template.yaml
Expand All @@ -53,6 +55,18 @@ jobs:
echo "The SemanticVersion value has not changed. Please update the SemanaticVersion value in the template.yaml file and try again."
exit 1
- name: create tag
if: env.updated == 'true'
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ env.current_version }}',
sha: context.sha
})
build:
name: build
needs: check_version
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: coralogix-aws-shipper tests
on:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy

- name: start ssh agent for rust private dependencies
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: run tests
run: |
cargo test --all -- --nocapture
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Changelog

## v0.0.3 Beta / 2023-12-20

## 💡 Enhancements 💡
- Moved internal logic to lib.rs and Added Integration tests

### 🧰 Bug fixes 🧰
- Fixed readme badge link for version

## v0.0.2 Beta / 2023-13-15
- Fix readme version link

### 🧰 Bug fixes 🧰
- Lambda fail on empty empty gzip file for ELB logs.
Expand Down
Loading

0 comments on commit 657ac57

Please sign in to comment.