File tree 2 files changed +57
-0
lines changed
2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,47 @@ jobs:
316
316
- store_test_results :
317
317
path : /tmp/logs
318
318
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
319
360
320
361
deploy :
321
362
<< : *defaults
@@ -379,6 +420,15 @@ workflows:
379
420
tags :
380
421
only : /^v.*/
381
422
423
+ - mock_aws_test :
424
+ context :
425
+ - Gruntwork Admin
426
+ requires :
427
+ - setup
428
+ filters :
429
+ tags :
430
+ only : /^v.*/
431
+
382
432
- deploy :
383
433
context :
384
434
- Gruntwork Admin
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
+
1
8
package test
2
9
3
10
import (
You can’t perform that action at this time.
0 commit comments