Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
command: |
mkdir -p /tmp/test-reports
gotestsum --junitfile /tmp/test-reports/unit-tests.xml
- run:
name: Run coverage
command: go test -race -coverprofile=coverage.out -covermode=atomic
- run:
name: Upload coverage to Codecov
command: bash <(curl -s https://codecov.io/bash)
- store_test_results:
path: /tmp/test-reports

Expand Down Expand Up @@ -63,5 +69,6 @@ workflows:
only:
- master
- deploy-with-circle
- test-deploy
requires:
- build
13 changes: 12 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

//ProductionHosts should be configured to include all hosts the mobile can connect to
var ProductionHosts Hosts = []Host{
{name: "pacific", url: "https://pacific.withsempo.com"},
{name: "demo", url: "https://demo.withsempo.com"},
{name: "pacific", url: "https://pacific.withsempo.com"},
{name: "celo", url: "https://celo.withsempo.com"},
{name: "png", url: "https://png.withsempo.com"},
{name: "dev", url: "https://dev.withsempo.com"},
Expand Down Expand Up @@ -56,6 +56,16 @@ func CheckForValidAuth(host Host, inputBody string) (json []byte, ok bool) {
}

defer resp.Body.Close()
fmt.Println("----")
fmt.Println("jsonStr")
fmt.Println(jsonStr)
fmt.Println("resp")
fmt.Println(resp)
fmt.Println("resp.Body")
fmt.Println(resp.Body)
fmt.Println("resp.StatusCode")
fmt.Println(resp.StatusCode)
fmt.Println("----")

if !(resp.StatusCode >= 200 && resp.StatusCode <= 299) {
return nil, false
Expand Down Expand Up @@ -105,6 +115,7 @@ func HandleLambdaEvent(
headers := make(map[string]string)

headers["Access-Control-Allow-Origin"] = "*"
headers["TEST_HEADER"] = "*"
headers["Access-Control-Allow-Headers"] = "Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token"

// The WaitGroup will trigger the waitchannel if all host requests fail
Expand Down