Skip to content

Commit

Permalink
Merge pull request #12 from mysteriumnetwork/bug-report-endpoint
Browse files Browse the repository at this point in the history
bug report endpoint and update to go 1.21 +deps
  • Loading branch information
Guillembonet authored Oct 17, 2023
2 parents 00233de + 19b11a5 commit 792fae7
Show file tree
Hide file tree
Showing 35 changed files with 1,841 additions and 2,276 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @n10ty @Guillembonet
45 changes: 45 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and test

on: push

env:
GITHUB_CI: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Build Binary
run: go run mage.go -v build
unit-test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Run unit tests
run: go run mage.go -v test
e2e:
name: Run e2e scenarios
runs-on: ubuntu-latest
steps:
- shell: bash
env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
run: |
echo "$DOCKERHUB_PASSWORD" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin || true
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Run e2e scenarios
run: go run mage.go -v e2e

44 changes: 0 additions & 44 deletions .gitlab-ci.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM golang:1.17.6-alpine3.15 AS builder
FROM golang:1.21-alpine AS builder

# Install packages
RUN apk add --no-cache bash gcc musl-dev git curl
RUN apk add --no-cache bash gcc musl-dev linux-headers git curl

# Compile application
WORKDIR /src
ADD . .
RUN go run mage.go -v build

FROM alpine:3.15
FROM alpine:3.17

# Install application
COPY --from=builder /src/build/feedback /usr/bin/feedback
Expand Down
23 changes: 18 additions & 5 deletions ci/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package ci

import (
"fmt"
"os"
"time"

"github.com/cihub/seelog"
"github.com/magefile/mage/sh"
"github.com/mysteriumnetwork/feedback/di"
"github.com/mysteriumnetwork/feedback/params"
"github.com/rs/zerolog"
)

// E2E runs the e2e tests
Expand All @@ -22,13 +23,15 @@ func E2E() error {
// TODO: ping s3-mock and wiremock and await startup, it is very slow in the pipeline
time.Sleep(time.Second * 10)

logLevel := seelog.DebugStr
logLevel := zerolog.DebugLevel.String()
requestsPerSecond := 9999999999.0
logProxyBaseUrl := "http://someweb.com"
githubBaseUrlOverride := "http://localhost:8090/github/"
gparams := params.Generic{
LogLevelFlag: &logLevel,
RequestsPerSecond: &requestsPerSecond,
LogProxyBaseUrl: &logProxyBaseUrl,
LogLevelFlag: &logLevel,
RequestsPerSecond: &requestsPerSecond,
LogProxyBaseUrl: &logProxyBaseUrl,
GithubBaseUrlOverride: &githubBaseUrlOverride,
}

envAWSEndpointURL := "http://localhost:9090"
Expand All @@ -48,6 +51,16 @@ func E2E() error {
EnvGithubRepository: &envGithubRepository,
}

//set mock env vars
err = os.Setenv("AWS_ACCESS_KEY_ID", "test_key_id")
if err != nil {
return err
}
err = os.Setenv("AWS_SECRET_ACCESS_KEY", "test_secret_key")
if err != nil {
return err
}

fmt.Println("starting server...")

container := &di.Container{}
Expand Down
Loading

0 comments on commit 792fae7

Please sign in to comment.