File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,47 @@ jobs:
316316 - store_test_results :
317317 path : /tmp/logs
318318
319+ mock_aws_test :
320+ << : *env
321+ docker :
322+ - image : cimg/python:3.10.2
323+ steps :
324+ - attach_workspace :
325+ at : /home/circleci
326+ # - run:
327+ # <<: *install_gruntwork_utils
328+ - run :
329+ name : install mock aws server
330+ command : |
331+ pip install moto[server]
332+ - run :
333+ name : install aws cli
334+ command : |
335+ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
336+ unzip awscliv2.zip
337+ sudo ./aws/install
338+ - run :
339+ name : run mock aws server
340+ command : |
341+ moto_server | tee /tmp/logs/moto_server_output.log
342+ background : true
343+ - run :
344+ name : wait for mock aws server
345+ command : |
346+ while ! AWS_REGION=us-west-2 AWS_ACCESS_KEY_ID=dummy AWS_SECRET_ACCESS_KEY=dummy aws --endpoint http://localhost:5000 sts get-caller-identity; do
347+ echo "Waiting for local mock AWS server"
348+ sleep 1
349+ done
350+ - run :
351+ command : |
352+ mkdir -p /tmp/logs
353+ run-go-tests --packages "-tags=mockaws ./test/" | tee /tmp/logs/test_output.log
354+
355+ # Store test result and log artifacts for browsing purposes
356+ - store_artifacts :
357+ path : /tmp/logs
358+ - store_test_results :
359+ path : /tmp/logs
319360
320361 deploy :
321362 << : *defaults
@@ -386,6 +427,15 @@ workflows:
386427 tags :
387428 only : /^v.*/
388429
430+ - mock_aws_test :
431+ context :
432+ - Gruntwork Admin
433+ requires :
434+ - setup
435+ filters :
436+ tags :
437+ only : /^v.*/
438+
389439 - deploy :
390440 context :
391441 - AWS__PHXDEVOPS__circle-ci-test
Original file line number Diff line number Diff line change 1+ //go:build mockaws
2+ // +build mockaws
3+
4+ // NOTE: We use build tags to differentiate mockaws testing because this uses
5+ // a local mock AWS service
6+ // (https://docs.getmoto.org/en/latest/docs/server_mode.html)
7+
18package test
29
310import (
You can’t perform that action at this time.
0 commit comments