Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The New Transaction System's tests #233

Draft
wants to merge 62 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
337b655
Created new integration tests
alberttkt Nov 13, 2022
edd3573
setup possible to previously created node
alberttkt Nov 14, 2022
88e55a9
fixed performance test
alberttkt Nov 14, 2022
6fc8992
removed bad print statment
alberttkt Nov 14, 2022
9242a4a
fix comment
alberttkt Nov 14, 2022
798c5dd
load test and split files
alberttkt Nov 21, 2022
16cf2d5
Checking if Txn is included added to proxy.
mamine2207 Nov 21, 2022
8d742cb
renaming of a variable for clarity
mamine2207 Nov 21, 2022
a511d42
edit transaction system
alberttkt Nov 22, 2022
b568b36
add transaction response
alberttkt Nov 22, 2022
184ee54
Added function in APi for txn
mamine2207 Nov 22, 2022
7ee1055
Endpoint added
mamine2207 Nov 22, 2022
ee93ae8
renaming
alberttkt Nov 22, 2022
c2af472
Merge branch 'newTransactionSystem' of https://github.com/dedis/d-vot…
mamine2207 Nov 22, 2022
3c995ce
change TransactionResonse to TransactionInfo
alberttkt Nov 22, 2022
c078bb8
isTxnIncluded added
mamine2207 Nov 22, 2022
9b169a6
Merge branch 'newTransactionSystem' of https://github.com/dedis/d-vot…
mamine2207 Nov 22, 2022
ecb5830
change blocklink to it's index
alberttkt Nov 22, 2022
ce8a329
Merge branch 'main' into newTransactionSystem
alberttkt Nov 28, 2022
2d9584f
advanced the proxy implementation of
alberttkt Nov 28, 2022
d9c2d17
Almost working Election creation
alberttkt Nov 28, 2022
d7d6859
Merge branch 'main' into integrationTests
alberttkt Nov 30, 2022
1c5b4d7
small edit in load_test
alberttkt Nov 30, 2022
0037e62
Merge branch 'main' into integrationTests
alberttkt Nov 30, 2022
565b8bb
Merge branch 'main' into newTransactionSystem
alberttkt Nov 30, 2022
e1a2d7a
refactor integration test utility functions
alberttkt Dec 5, 2022
b464bc3
add new files
alberttkt Dec 5, 2022
e68134e
removed an integration test too long for github
alberttkt Dec 5, 2022
388d3ca
Refactor gitHub actions
alberttkt Dec 5, 2022
5fd305b
renamed calls
alberttkt Dec 5, 2022
cee74c7
Renamed some files, reformating
alberttkt Dec 7, 2022
5c3562a
refactor
alberttkt Dec 7, 2022
1cfffaf
fix github action
alberttkt Dec 7, 2022
6ed61fb
Working New transaction System
alberttkt Dec 8, 2022
e8fa91d
small fixes
alberttkt Dec 11, 2022
4272e6b
Comments refactoring
alberttkt Dec 11, 2022
89aee58
refactoring
alberttkt Dec 12, 2022
3966c72
comments and refactoring
alberttkt Dec 12, 2022
d980543
reformat
alberttkt Dec 12, 2022
e26f4a8
Created new integration tests
alberttkt Nov 13, 2022
d8fd2ad
fix comment
alberttkt Nov 14, 2022
7f5d41f
load test and split files
alberttkt Nov 21, 2022
eb7385d
add new files
alberttkt Dec 5, 2022
e57754f
Refactor gitHub actions
alberttkt Dec 5, 2022
c670e1a
renamed calls
alberttkt Dec 5, 2022
b1ad761
Renamed some files, reformating
alberttkt Dec 7, 2022
781a007
fix github action
alberttkt Dec 7, 2022
999b888
Merge branch 'integrationTests' into newTransactionSystem
alberttkt Dec 12, 2022
7915d4c
begin adapting scenario test
alberttkt Dec 12, 2022
8497604
integration test
alberttkt Dec 12, 2022
ade4817
scenario test should work
alberttkt Dec 12, 2022
8b7a126
integration test fix
alberttkt Dec 12, 2022
8eb18d4
change scenario test to 5 nodes
alberttkt Dec 12, 2022
1826f67
reformat
alberttkt Dec 12, 2022
d959f90
factrorisation in scenario_test
alberttkt Dec 12, 2022
d1b36cc
Refactoring of scenario and load tests
alberttkt Dec 12, 2022
f8d77e3
reformat
alberttkt Dec 12, 2022
e751006
Load Test updated
alberttkt Dec 12, 2022
10357c5
test for shuffle
mamine2207 Dec 13, 2022
270d078
reformat of shuffle_test
mamine2207 Dec 13, 2022
17cdaf1
txn tests
mamine2207 Dec 13, 2022
4f0bb44
comment shortened
mamine2207 Dec 13, 2022
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
57 changes: 49 additions & 8 deletions .github/workflows/go_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,64 @@ name: Go Integration Test

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:

test:
name: Tests
integration:
name: Test Integration
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.17
uses: actions/setup-go@v2
with:
go-version: ^1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Run the integration test
run: go test -timeout 7m -run TestIntegration ./integration/...
run: go test -timeout 10m -run TestIntegration ./integration/...
bad_vote:
name: Test bad vote
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.17
uses: actions/setup-go@v2
with:
go-version: ^1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Run the bad vote test
run: go test -timeout 10m -run TestBadVote ./integration/...
crash:
name: Test crash
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.17
uses: actions/setup-go@v2
with:
go-version: ^1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Run the crash test
run: go test -timeout 10m -run TestCrash ./integration/...
revote:
name: Test revote
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.17
uses: actions/setup-go@v2
with:
go-version: ^1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Run the revote test
run: go test -timeout 10m -run TestRevote ./integration/...
13 changes: 6 additions & 7 deletions .github/workflows/go_scenario_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ name: Go Scenario Test (with proxy)

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:

test:
name: Tests
runs-on: ubuntu-latest
Expand All @@ -22,18 +21,18 @@ jobs:
git clone https://github.com/dedis/dela.git
cd dela
go install ./cli/crypto

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Create a private key
run: crypto bls signer new --save private.key

- name: Install memcoin
run: make build

- name: Start and setup 3 nodes
run: ./runSystems.sh -n 3 --docker false --backend false --frontend false --attach false
- name: Start and setup 5 nodes
run: ./runSystems.sh -n 5 --docker false --backend false --frontend false --attach false

- name: Run the scenario Test
run: go test -timeout 7m -run TestScenario ./integration/...
8 changes: 6 additions & 2 deletions contracts/evoting/controller/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ func (a *RegisterAction) Execute(ctx node.Context) error {
return xerrors.Errorf("failed to resolve ordering.Service: %v", err)
}

var blocks *blockstore.InDisk
var blocks blockstore.BlockStore
err = ctx.Injector.Resolve(&blocks)
if err != nil {
return xerrors.Errorf("failed to resolve blockstore.InDisk: %v", err)
}


var ordering ordering.Service

err = ctx.Injector.Resolve(&ordering)
Expand Down Expand Up @@ -163,11 +164,12 @@ func (a *RegisterAction) Execute(ctx node.Context) error {
return xerrors.Errorf("failed to unmarshal proxy key: %v", err)
}

ep := eproxy.NewForm(ordering, mngr, p, sjson.NewContext(), formFac, proxykey)
ep := eproxy.NewForm(ordering, mngr, p, sjson.NewContext(), formFac, proxykey,blocks,signer)

router := mux.NewRouter()

router.HandleFunc(formPath, ep.NewForm).Methods("POST")
router.HandleFunc("/evoting/transactions/{token}", ep.IsTxnIncluded).Methods("GET")
router.HandleFunc(formPath, ep.Forms).Methods("GET")
router.HandleFunc(formPath, eproxy.AllowCORS).Methods("OPTIONS")
router.HandleFunc(formIDPath, ep.Form).Methods("GET")
Expand All @@ -181,6 +183,8 @@ func (a *RegisterAction) Execute(ctx node.Context) error {

proxy.RegisterHandler(formPath, router.ServeHTTP)
proxy.RegisterHandler(formPathSlash, router.ServeHTTP)
proxy.RegisterHandler("/evoting/transactions", router.ServeHTTP)
proxy.RegisterHandler("/evoting/transactions/", router.ServeHTTP)

dela.Logger.Info().Msg("d-voting proxy handlers registered")

Expand Down
Loading