Skip to content

Commit

Permalink
Merge pull request #116 from c4dt/fix_go_version
Browse files Browse the repository at this point in the history
Fix all go version in the tests on 1.20
  • Loading branch information
ineiti authored Feb 15, 2024
2 parents aca09c9 + 1a89820 commit f0fabf1
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 40 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/go_dvoting_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
name: Scenario
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.17
uses: actions/setup-go@v2
- name: Use Go 1.20
uses: actions/setup-go@v4
with:
go-version: ^1.17
go-version: '1.20'

- name: Install crypto util from Dela
run: |
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/go_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
name: Integration test
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.17
uses: actions/setup-go@v2
- name: Use Go 1.20
uses: actions/setup-go@v4
with:
go-version: ^1.17
go-version: '1.20'

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -25,10 +25,10 @@ jobs:
name: Test bad vote
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.17
uses: actions/setup-go@v2
- name: Use Go 1.20
uses: actions/setup-go@v4
with:
go-version: ^1.17
go-version: '1.20'

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -39,10 +39,10 @@ jobs:
name: Test crash
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.17
uses: actions/setup-go@v2
- name: Use Go 1.20
uses: actions/setup-go@v4
with:
go-version: ^1.17
go-version: '1.20'

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -53,10 +53,10 @@ jobs:
name: Test revote
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.17
uses: actions/setup-go@v2
- name: Use Go 1.20
uses: actions/setup-go@v4
with:
go-version: ^1.17
go-version: '1.20'

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/go_scenario_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.17
uses: actions/setup-go@v2
- name: Use Go 1.20
uses: actions/setup-go@v4
with:
go-version: ^1.17
go-version: '1.20'

- name: Install crypto util from Dela
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/go_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Use Go >= 1.19
uses: actions/setup-go@v3
- name: Use Go 1.20
uses: actions/setup-go@v4
with:
go-version: '>=1.19'
go-version: '1.20'
id: go

- name: Check out code into the Go module directory
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
- name: checkout
uses: actions/checkout@v3

- name: Use go
uses: actions/setup-go@v3
- name: Use Go 1.20
uses: actions/setup-go@v4
with:
go-version: '>=1.18'
go-version: '1.20'

- name: Install fpm
run: |
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/c4dt/d-voting

go 1.19
go 1.20

require (
github.com/gorilla/mux v1.8.0
Expand Down
6 changes: 0 additions & 6 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ func getIntegrationTest(numNodes, numVotes int) func(*testing.T) {
adminID := "first admin"

// ##### SETUP ENV #####
// make tests reproducible
rand.Seed(1)

delaPkg.Logger = delaPkg.Logger.Level(zerolog.WarnLevel)

Expand Down Expand Up @@ -178,8 +176,6 @@ func getIntegrationTestCrash(numNodes, numVotes, failingNodes int) func(*testing
adminID := "first admin"

// ##### SETUP ENV #####
// make tests reproducible
rand.Seed(1)

delaPkg.Logger = delaPkg.Logger.Level(zerolog.WarnLevel)

Expand Down Expand Up @@ -328,8 +324,6 @@ func getIntegrationBenchmark(numNodes, numVotes int) func(*testing.B) {
adminID := "first admin"

// ##### SETUP ENV #####
// make tests reproducible
rand.Seed(1)

delaPkg.Logger = delaPkg.Logger.Level(zerolog.WarnLevel)

Expand Down
3 changes: 0 additions & 3 deletions integration/performance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"crypto/sha256"
"encoding/base64"
"fmt"
"math/rand"
"os"
"strconv"
"strings"
Expand All @@ -31,8 +30,6 @@ func BenchmarkIntegration_CustomVotesScenario(b *testing.B) {
adminID := "I am an admin"

// ##### SETUP ENV #####
// make tests reproducible
rand.Seed(1)

dirPath, err := os.MkdirTemp(os.TempDir(), "d-voting-three-votes")
require.NoError(b, err)
Expand Down
1 change: 0 additions & 1 deletion integration/scenario_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func getScenarioTest(numNodes int, numVotes int, numForm int) func(*testing.T) {

func startFormProcess(wg *sync.WaitGroup, numNodes, numVotes, numSec int, proxyArray []string, t *testing.T, numForm int, testType testType) {
defer wg.Done()
rand.Seed(0)

const contentType = "application/json"
secretkeyBuf, err := hex.DecodeString("28912721dfd507e198b31602fb67824856eb5a674c021d49fdccbe52f0234409")
Expand Down
5 changes: 0 additions & 5 deletions integration/votes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package integration

import (
"fmt"
"math/rand"
"os"
"strconv"

Expand Down Expand Up @@ -34,8 +33,6 @@ func getIntegrationTestBadVote(numNodes, numVotes, numBadVotes int) func(*testin
adminID := "first admin"

// ##### SETUP ENV #####
// make tests reproducible
rand.Seed(1)

delaPkg.Logger = delaPkg.Logger.Level(zerolog.WarnLevel)

Expand Down Expand Up @@ -174,8 +171,6 @@ func getIntegrationTestRevote(numNodes, numVotes, numRevotes int) func(*testing.
adminID := "first admin"

// ##### SETUP ENV #####
// make tests reproducible
rand.Seed(1)

delaPkg.Logger = delaPkg.Logger.Level(zerolog.WarnLevel)

Expand Down

0 comments on commit f0fabf1

Please sign in to comment.