diff --git a/.github/workflows/go_dvoting_test.yml b/.github/workflows/go_dvoting_test.yml index f98569577..19acabb77 100644 --- a/.github/workflows/go_dvoting_test.yml +++ b/.github/workflows/go_dvoting_test.yml @@ -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: | diff --git a/.github/workflows/go_integration_tests.yml b/.github/workflows/go_integration_tests.yml index 5b0cfc9dd..e3dc9fca2 100644 --- a/.github/workflows/go_integration_tests.yml +++ b/.github/workflows/go_integration_tests.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/go_scenario_test.yml b/.github/workflows/go_scenario_test.yml index c2e609697..c6f274417 100644 --- a/.github/workflows/go_scenario_test.yml +++ b/.github/workflows/go_scenario_test.yml @@ -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: | diff --git a/.github/workflows/go_test.yml b/.github/workflows/go_test.yml index dba5a8188..302364b03 100644 --- a/.github/workflows/go_test.yml +++ b/.github/workflows/go_test.yml @@ -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 diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index a4b775e5f..84d119f27 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -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: | diff --git a/go.mod b/go.mod index 01a0b65dc..ad9c4034c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/c4dt/d-voting -go 1.19 +go 1.20 require ( github.com/gorilla/mux v1.8.0 diff --git a/integration/integration_test.go b/integration/integration_test.go index b6bd9fcf1..4833a3663 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -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) @@ -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) @@ -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) diff --git a/integration/performance_test.go b/integration/performance_test.go index aaeb38a51..7a4233e55 100644 --- a/integration/performance_test.go +++ b/integration/performance_test.go @@ -4,7 +4,6 @@ import ( "crypto/sha256" "encoding/base64" "fmt" - "math/rand" "os" "strconv" "strings" @@ -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) diff --git a/integration/scenario_test.go b/integration/scenario_test.go index d2c636689..cd1473b32 100644 --- a/integration/scenario_test.go +++ b/integration/scenario_test.go @@ -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") diff --git a/integration/votes_test.go b/integration/votes_test.go index 53eb765af..207798f18 100644 --- a/integration/votes_test.go +++ b/integration/votes_test.go @@ -2,7 +2,6 @@ package integration import ( "fmt" - "math/rand" "os" "strconv" @@ -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) @@ -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)