From 0d5bfa106292abe1e4324e6c3abe50fce4dda675 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 11 Jun 2024 21:43:59 +0200 Subject: [PATCH 01/10] feat added env ability to e2e tests --- .github/workflows/cypress-test-basic.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cypress-test-basic.yaml b/.github/workflows/cypress-test-basic.yaml index 14453cce..23973c11 100644 --- a/.github/workflows/cypress-test-basic.yaml +++ b/.github/workflows/cypress-test-basic.yaml @@ -1,6 +1,7 @@ name: End-to-end tests on: workflow_dispatch: + c: pull_request: branches: - main @@ -54,7 +55,10 @@ jobs: ${{ runner.os }}-build- - name: Start server run: | - cd + cd $GITHUB_WORKSPACE + touch fe.env + touch api.env + touch db.env docker compose up -d - name: Cypress run uses: cypress-io/github-action@v6 From 90319cdb5b0dc10e39b43cbc9d66179996d8705e Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 14 Jun 2024 23:21:22 +0200 Subject: [PATCH 02/10] feat gitignore to accomodate act shell script --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 766e6d78..3a590fa7 100644 --- a/.gitignore +++ b/.gitignore @@ -120,6 +120,6 @@ ProjectSettings/ # Custom patterns # ################### # Add any custom patterns here - +actScript.sh # End of the file # ################### From d1dbadf05ed9a16de05e3e15fcde7840ccc77478 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 17 Jun 2024 19:25:23 +0200 Subject: [PATCH 03/10] Added deployment workflow file --- .github/workflows/deployment.yaml | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/deployment.yaml diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml new file mode 100644 index 00000000..ba8d5e15 --- /dev/null +++ b/.github/workflows/deployment.yaml @@ -0,0 +1,70 @@ +name: Deployment + +on: + workflow_run: + fork: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Make db env file + uses: SpicyPizza/create-envfile@v1.3 + with: + envkey_POSTGRES_PASSWORD : ${{ secrets.POSTGRES_PASSWORD }} + envkey_POSTGRES_USER : ${{ secrets.POSTGRES_USER }} + envkey_POSTGRES_DB : ${{ secrets.POSTGRES_DB }} + directory: . + file_name: db.env + fail_on_empty: false + - name: Make api env files + uses: SpicyPizza/create-envfile@v1.3 + with: + envkey_DATABASE_URL : ${{ secrets.DATABASE_URL }} + envkey_DATABASE_PORT : ${{ secrets.DATABASE_PORT }} + envkey_DATABASE_NAME : ${{ secrets.DATABASE_NAME }} + envkey_DATABASE_USER : ${{ secrets.DATABASE_USER }} + envkey_DATABASE_PASSWORD : ${{ secrets.DATABASE_PASSWORD }} + envkey_COMPANY_EMAIL : ${{ secrets.COMPANY_EMAIL }} + envkey_COMPANY_AUTH : ${{ secrets.COMPANY_AUTH }} + directory: . + file_name: api.env + fail_on_empty: false + - name: Make fe env files + uses: SpicyPizza/create-envfile@v1.3 + with: + envkey_API_URL : ${{ secrets.API_URL }} + directory: . + file_name: fe.env + fail_on_empty: false + + - name: Docker compose build + run: | + cd $GITHUB_WORKSPACE + docker compose build + - name: Make it a tar file + run: | + cd $GITHUB_WORKSPACE + docker save -o app.tar app + # - name: Send through the docker container using SCP + # uses: appleboy/scp-action@v0.1.4 + # with: + # host: ${{ secrets.SSH_HOST }} + # username: ${{ secrets.SSH_USERNAME }} + # password: ${{ secrets.SSH_PASSWORD }} + # port: ${{ secrets.SSH_PORT }} + # source: app.tar + # target: ./ + # - name: Spin up docker image + # uses: appleboy/ssh-action@v1.0.0 + # with: + # host: ${{ secrets.SSH_HOST }} + # username: ${{ secrets.SSH_USERNAME }} + # password: ${{ secrets.SSH_PASSWORD }} + # port: ${{ secrets.SSH_PORT }} + # script: | + # docker load -i app.tar + # docker run -d -p 80:80 app + From bbafd2f14167b9a43a47710472e3df5ac49ff64f Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 18 Jun 2024 16:17:38 +0200 Subject: [PATCH 04/10] started testing scp and ssh --- .github/workflows/deployment.yaml | 46 +++++++++++++++++-------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index ba8d5e15..dd95c42c 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -47,24 +47,30 @@ jobs: - name: Make it a tar file run: | cd $GITHUB_WORKSPACE - docker save -o app.tar app - # - name: Send through the docker container using SCP - # uses: appleboy/scp-action@v0.1.4 - # with: - # host: ${{ secrets.SSH_HOST }} - # username: ${{ secrets.SSH_USERNAME }} - # password: ${{ secrets.SSH_PASSWORD }} - # port: ${{ secrets.SSH_PORT }} - # source: app.tar - # target: ./ - # - name: Spin up docker image - # uses: appleboy/ssh-action@v1.0.0 - # with: - # host: ${{ secrets.SSH_HOST }} - # username: ${{ secrets.SSH_USERNAME }} - # password: ${{ secrets.SSH_PASSWORD }} - # port: ${{ secrets.SSH_PORT }} - # script: | - # docker load -i app.tar - # docker run -d -p 80:80 app + docker save -o frontend.tar dispute-resolution-engine-frontend:latest + docker save -o api.tar api + docker save -o postgres.tar postgres + + - name: Send through the docker container using + + uses: appleboy/scp-action@v0.1.4 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + password: ${{ secrets.SSH_PASSWORD }} + port: ${{ secrets.SSH_PORT }} + source: "api.tar,frontend.tar,postgres.tar,docker-compose.yaml" + target: ./ + - name: Spin up docker image + uses: appleboy/ssh-action@v1.0.0 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + password: ${{ secrets.SSH_PASSWORD }} + port: ${{ secrets.SSH_PORT }} + script: | + docker load -i frontend.tar + docker load -i api.tar + docker load -i postgres.tar + docker-compose up -d From 222fa87bdafecbd190fc46b04d6a17c705e5ca28 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 22 Jun 2024 19:06:04 +0200 Subject: [PATCH 05/10] Added WireGuard config --- .github/workflows/deployment.yaml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index dd95c42c..86f53c62 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -44,15 +44,34 @@ jobs: run: | cd $GITHUB_WORKSPACE docker compose build + - name: Make it a tar file run: | cd $GITHUB_WORKSPACE docker save -o frontend.tar dispute-resolution-engine-frontend:latest docker save -o api.tar api docker save -o postgres.tar postgres - - - name: Send through the docker container using + - name: Install wireguard + run: sudo apt-get install wireguard + + - name: Create WG Config + run: | + sed -i -e "s@{{WG_PRIVATEKEY}}@${{ secrets.WG_PRIVATEKEY }}@" $GITHUB_WORKSPACE/tunnel.conf + sed -i -e "s@{{WG_ADDRESS}}@${{ secrets.WG_ADDRESS }}@" $GITHUB_WORKSPACE/tunnel.conf + sed -i -e "s@{{WG_DNS}}@${{ secrets.WG_DNS }}@" $GITHUB_WORKSPACE/tunnel.conf + sed -i -e "s@{{WG_PUBLICKEY}}@${{ secrets.WG_PUBLICKEY }}@" $GITHUB_WORKSPACE/tunnel.conf + sed -i -e "s@{{WG_ALLOWEDIPS}}@${{ secrets.WG_ALLOWEDIPS }}@" $GITHUB_WORKSPACE/tunnel.conf + sed -i -e "s@{{WG_ENDPOINT}}@${{ secrets.WG_ENDPOINT }}@" $GITHUB_WORKSPACE/tunnel.conf + sudo cp $GITHUB_WORKSPACE/tunnel.conf /etc/wireguard/ + + - name: WG Creating Tunnel + run: | + sudo apt install resolvconf + wg-quick up $GITHUB_WORKSPACE/tunnel.conf + + + - name: Send through the docker container using scp uses: appleboy/scp-action@v0.1.4 with: host: ${{ secrets.SSH_HOST }} From 515f3708cdbe1c26abf4bf3745071fa21a1b919e Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 22 Jun 2024 19:20:53 +0200 Subject: [PATCH 06/10] feat added cypress test after deployment --- .github/workflows/deployment.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 86f53c62..4fa734d1 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -92,4 +92,17 @@ jobs: docker load -i api.tar docker load -i postgres.tar docker-compose up -d - + cypress-test: + container: + image: cypress/included + needs: deploy + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + wait-on: 'http://capstone-dre.dns.net.za' + wait-on-timeout: 300 From 2912e9a14528efc31a48953fd8cc15e370ad3809 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 23 Jun 2024 12:59:00 +0200 Subject: [PATCH 07/10] Added code coverage --- .github/workflows/deployment.yaml | 4 ++++ .github/workflows/go-test.yaml | 6 +++++- .github/workflows/jest-test.yaml | 6 +++++- README.md | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 4fa734d1..979eb2dc 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -106,3 +106,7 @@ jobs: with: wait-on: 'http://capstone-dre.dns.net.za' wait-on-timeout: 300 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/go-test.yaml b/.github/workflows/go-test.yaml index 5e6a5a8f..3105d872 100644 --- a/.github/workflows/go-test.yaml +++ b/.github/workflows/go-test.yaml @@ -21,4 +21,8 @@ jobs: - name: Run go test run: | cd api/__tests__ - go test \ No newline at end of file + go test + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/jest-test.yaml b/.github/workflows/jest-test.yaml index 4aa4ca71..fbfe06fd 100644 --- a/.github/workflows/jest-test.yaml +++ b/.github/workflows/jest-test.yaml @@ -28,4 +28,8 @@ jobs: - name: Run jest run: | cd frontend - yarn test \ No newline at end of file + yarn test + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index fb68221a..fb3c995f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ - + From c57c2b801922d6d80827510df6b31e998ed0a878 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 23 Jun 2024 13:10:42 +0200 Subject: [PATCH 08/10] added db tests --- api/__tests__/db/db_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 api/__tests__/db/db_test.go diff --git a/api/__tests__/db/db_test.go b/api/__tests__/db/db_test.go new file mode 100644 index 00000000..c04bcc48 --- /dev/null +++ b/api/__tests__/db/db_test.go @@ -0,0 +1,18 @@ +package api + +import ( + "testing" + // "api/db" + //"github.com/stretchr/testify/assert" +) + +type MockStorage struct{} + +// func TestNewServer(t *testing.T) { +// store, err := storage.NewPostgresStore() +// server := api.NewServer(":8080", store) +// server.Run() +// } +func TestRandomSales(t *testing.T) { + +} \ No newline at end of file From 468ef2d2a1382a251659f402f6f4d16f6be8674b Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 23 Jun 2024 16:43:58 +0200 Subject: [PATCH 09/10] feat added go tests --- .github/workflows/tests.yaml | 68 ++++++++++++++++++++++++++++++++++++ api/__tests__/api-test.go | 25 ------------- api/__tests__/auth_test.go | 53 ++++++++++++++++++++++++++++ api/__tests__/db/db_test.go | 18 ---------- api/__tests__/db_test.go | 27 ++++++++++++++ api/__tests__/model_test.go | 19 ---------- api/go.mod | 2 +- api/go.sum | 2 ++ 8 files changed, 151 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/tests.yaml delete mode 100644 api/__tests__/api-test.go create mode 100644 api/__tests__/auth_test.go delete mode 100644 api/__tests__/db/db_test.go create mode 100644 api/__tests__/db_test.go delete mode 100644 api/__tests__/model_test.go diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 00000000..30b2f3e1 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,68 @@ +name: Unit-And-Integration-Tests +run-name: ${{ github.actor }} at ${{ github.event_name }} event +on: + workflow_dispatch: + pull_request: + branches: + - main + - release + - dev + types: + - opened + - reopened +jobs: + setup server: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: '18.20.3' + - name: Install dependencies + run: | + cd frontend + npm install -g yarn + yarn + - name: Build Docker + run: | + docker compose build + docker compose up -d + run jest tests: + runs-on: ubuntu-latest + depends-on: setup server + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: '18.20.3' + - name: Install dependencies + run: | + cd frontend + npm install -g yarn + yarn + - name: Run jest + run: | + cd frontend + yarn test + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + run go tests: + runs-on: ubuntu-latest + depends-on: setup server + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run go test + run: | + cd api/__tests__ + go test + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/api/__tests__/api-test.go b/api/__tests__/api-test.go deleted file mode 100644 index 004e2847..00000000 --- a/api/__tests__/api-test.go +++ /dev/null @@ -1,25 +0,0 @@ -package api - -import ( - "testing" - "api/api" - //"github.com/stretchr/testify/assert" -) - -type MockStorage struct{} - -// func TestNewServer(t *testing.T) { -// store, err := storage.NewPostgresStore() -// server := api.NewServer(":8080", store) -// server.Run() -// } -func TestRandomSales(t *testing.T) { - secret, err := api.RandomSalt(32) - if err != nil { - t.Errorf("RandomSalt() error = %v", err) - return - } - if len(secret) != 32 { - t.Errorf("RandomSalt() = %v, want %v", len(secret), 32) - } -} \ No newline at end of file diff --git a/api/__tests__/auth_test.go b/api/__tests__/auth_test.go new file mode 100644 index 00000000..4dc52da7 --- /dev/null +++ b/api/__tests__/auth_test.go @@ -0,0 +1,53 @@ +package api + +import ( + "api/handlers" + "api/db" // Import the package that contains the db symbol + "net/http" + "net/http/httptest" + "strings" + "testing" +) + +// MockResponseWriter is used to capture the HTTP response +type MockResponseWriter struct { + httptest.ResponseRecorder +} + +func TestCreateUser(t *testing.T) { + DB := db.Init() + // Example of a valid request body + validRequestBody := `{"first_name":"John","surname":"Doe","birthdate":"1990-01-01","nationality":"Country","email":"john.doe@example.com"}` + // Example of an invalid request body (incomplete JSON) + invalidRequestBody := `{"first_name":"John"` + + tests := []struct { + name string + body string + expectedStatus int + }{ + {"Valid Request", validRequestBody, http.StatusOK}, + {"Invalid Request", invalidRequestBody, http.StatusBadRequest}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + request, err := http.NewRequest("POST", "/createuser", strings.NewReader(tt.body)) + if err != nil { + t.Fatal(err) + } + + // Use httptest.ResponseRecorder to capture the response + responseRecorder := httptest.NewRecorder() + handler := handlers.New(DB) + + // Serve the HTTP request to our handler + handler.CreateUser(responseRecorder, request) + + // Check the status code is what we expect + if status := responseRecorder.Code; status != tt.expectedStatus { + t.Errorf("handler returned wrong status code: got %v want %v", + status, tt.expectedStatus) + } + }) + } +} \ No newline at end of file diff --git a/api/__tests__/db/db_test.go b/api/__tests__/db/db_test.go deleted file mode 100644 index c04bcc48..00000000 --- a/api/__tests__/db/db_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package api - -import ( - "testing" - // "api/db" - //"github.com/stretchr/testify/assert" -) - -type MockStorage struct{} - -// func TestNewServer(t *testing.T) { -// store, err := storage.NewPostgresStore() -// server := api.NewServer(":8080", store) -// server.Run() -// } -func TestRandomSales(t *testing.T) { - -} \ No newline at end of file diff --git a/api/__tests__/db_test.go b/api/__tests__/db_test.go new file mode 100644 index 00000000..ef082f86 --- /dev/null +++ b/api/__tests__/db_test.go @@ -0,0 +1,27 @@ +package api + +import ( + "api/db" + "api/handlers" + "log" + "net/http" + "github.com/gorilla/mux" + + "testing" +) + +type MockStorage struct{} + +func TestInit(t *testing.T) { + DB := db.Init() + if DB == nil { + t.Errorf("Expected db to be initialized, got nil") + } + h := handlers.New(DB) + router := mux.NewRouter() + + router.HandleFunc("/createAcc", h.CreateUser).Methods(http.MethodPost) + router.HandleFunc("/login", h.LoginUser).Methods(http.MethodPost) + log.Println("API server is running on port 8080") + +} \ No newline at end of file diff --git a/api/__tests__/model_test.go b/api/__tests__/model_test.go deleted file mode 100644 index c5e87517..00000000 --- a/api/__tests__/model_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package api - -import ( - "testing" - "api/model" - //"github.com/stretchr/testify/assert" -) - -// func TestNewServer(t *testing.T) { -// store, err := storage.NewPostgresStore() -// server := api.NewServer(":8080", store) -// server.Run() -// } -func TestAuthUserCreation(t *testing.T) { - user := model.AuthUser() - if user == nil { - t.Fatalf("AuthUser() = nil, want &LoginUser{}") - } -} \ No newline at end of file diff --git a/api/go.mod b/api/go.mod index 0db20ca9..639197ed 100644 --- a/api/go.mod +++ b/api/go.mod @@ -10,7 +10,7 @@ require ( require ( github.com/gorilla/mux v1.8.1 golang.org/x/crypto v0.24.0 - gorm.io/driver/postgres v1.5.7 + gorm.io/driver/postgres v1.5.9 gorm.io/gorm v1.25.10 ) diff --git a/api/go.sum b/api/go.sum index 12c437ee..0d66fde2 100644 --- a/api/go.sum +++ b/api/go.sum @@ -40,5 +40,7 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/postgres v1.5.7 h1:8ptbNJTDbEmhdr62uReG5BGkdQyeasu/FZHxI0IMGnM= gorm.io/driver/postgres v1.5.7/go.mod h1:3e019WlBaYI5o5LIdNV+LyxCMNtLOQETBXL2h4chKpA= +gorm.io/driver/postgres v1.5.9 h1:DkegyItji119OlcaLjqN11kHoUgZ/j13E0jkJZgD6A8= +gorm.io/driver/postgres v1.5.9/go.mod h1:DX3GReXH+3FPWGrrgffdvCk3DQ1dwDPdmbenSkweRGI= gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s= gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= From 33dd64ba97863b81df387cb6f0f2c9f5f13ed906 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 23 Jun 2024 16:57:02 +0200 Subject: [PATCH 10/10] feat stubbed everything --- .github/workflows/cypress-test-basic.yaml | 9 --------- .github/workflows/deployment.yaml | 1 - .github/workflows/go-test.yaml | 8 -------- .github/workflows/jest-test.yaml | 8 -------- .github/workflows/lint.yaml | 8 -------- .github/workflows/tests.yaml | 8 -------- api/__tests__/auth_test.go | 2 +- api/__tests__/db_test.go | 2 -- 8 files changed, 1 insertion(+), 45 deletions(-) diff --git a/.github/workflows/cypress-test-basic.yaml b/.github/workflows/cypress-test-basic.yaml index 23973c11..7f0a1b39 100644 --- a/.github/workflows/cypress-test-basic.yaml +++ b/.github/workflows/cypress-test-basic.yaml @@ -1,15 +1,6 @@ name: End-to-end tests on: workflow_dispatch: - c: - pull_request: - branches: - - main - - release - - dev - types: - - opened - - reopened jobs: cypress-run: runs-on: ubuntu-22.04 diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 979eb2dc..b83c797c 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -2,7 +2,6 @@ name: Deployment on: workflow_run: - fork: jobs: deploy: diff --git a/.github/workflows/go-test.yaml b/.github/workflows/go-test.yaml index 3105d872..9d141070 100644 --- a/.github/workflows/go-test.yaml +++ b/.github/workflows/go-test.yaml @@ -2,14 +2,6 @@ name: Go Test run-name: ${{ github.actor }} at ${{ github.event_name }} event on: workflow_dispatch: - pull_request: - branches: - - main - - release - - dev - types: - - opened - - reopened jobs: go-test: runs-on: ubuntu-latest diff --git a/.github/workflows/jest-test.yaml b/.github/workflows/jest-test.yaml index fbfe06fd..133fccc2 100644 --- a/.github/workflows/jest-test.yaml +++ b/.github/workflows/jest-test.yaml @@ -2,14 +2,6 @@ name: Jest-Test run-name: ${{ github.actor }} at ${{ github.event_name }} event on: workflow_dispatch: - pull_request: - branches: - - main - - release - - dev - types: - - opened - - reopened jobs: jest-test: runs-on: ubuntu-latest diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index f9261f88..2fc03ce1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -2,14 +2,6 @@ name: Linting run-name: ${{ github.actor }} at ${{ github.event_name }} event on: workflow_dispatch: - pull_request: - branches: - - main - - release - - dev - types: - - opened - - reopened jobs: jest-test: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 30b2f3e1..88a7c231 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,14 +2,6 @@ name: Unit-And-Integration-Tests run-name: ${{ github.actor }} at ${{ github.event_name }} event on: workflow_dispatch: - pull_request: - branches: - - main - - release - - dev - types: - - opened - - reopened jobs: setup server: runs-on: ubuntu-latest diff --git a/api/__tests__/auth_test.go b/api/__tests__/auth_test.go index 4dc52da7..171208e4 100644 --- a/api/__tests__/auth_test.go +++ b/api/__tests__/auth_test.go @@ -2,7 +2,7 @@ package api import ( "api/handlers" - "api/db" // Import the package that contains the db symbol + "api/db" // Import the package that contains the db symbo "net/http" "net/http/httptest" "strings" diff --git a/api/__tests__/db_test.go b/api/__tests__/db_test.go index ef082f86..d4b4171d 100644 --- a/api/__tests__/db_test.go +++ b/api/__tests__/db_test.go @@ -3,7 +3,6 @@ package api import ( "api/db" "api/handlers" - "log" "net/http" "github.com/gorilla/mux" @@ -22,6 +21,5 @@ func TestInit(t *testing.T) { router.HandleFunc("/createAcc", h.CreateUser).Methods(http.MethodPost) router.HandleFunc("/login", h.LoginUser).Methods(http.MethodPost) - log.Println("API server is running on port 8080") } \ No newline at end of file