Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Commit

Permalink
testing travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ineiti committed Jan 15, 2020
1 parent da177ef commit 5e10dab
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ install:
- go get github.com/mattn/goveralls

script:
- make test
- make test_loop

after_success:
- $GOPATH/bin/goveralls -coverprofile=profile.cov -service=travis-ci
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ test_local:
go test -v -race -short -p=1 ./...

test_codecov:
for i in $$( seq 10 ); do echo "******* Run $$i"; echo; ./coveralls.sh; done
./coveralls.sh

test_loop:
for i in $$( seq 100 ); \
do echo "******* Run $$i"; echo; \
go test -v -short -p=1 -run Agg -count 10 ./services/ > run.log || \
( cat run.log; exit 1 ) || exit 1; \
done

test: test_fmt test_lint test_codecov

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/stretchr/testify v1.4.0
github.com/urfave/cli v1.22.2
go.dedis.ch/kyber/v3 v3.0.11
go.dedis.ch/onet/v3 v3.0.29
go.dedis.ch/onet/v3 v3.0.31
golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933 // indirect
Expand Down
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ go.dedis.ch/onet/v3 v3.0.29 h1:7kG+gY0zQQ7mMjePewCxQQaMZwtns2020jY8uN5/Pcg=
go.dedis.ch/onet/v3 v3.0.29/go.mod h1:eRhl/hDplVZQnvW9J67Q22vSMZO1umUS4DLY8wFY+b8=
go.dedis.ch/onet/v3 v3.0.30 h1:V5m8oqhFlbxACzlRyTeXOzrRKst6QFG6Obktqwuhapw=
go.dedis.ch/onet/v3 v3.0.30/go.mod h1:eRhl/hDplVZQnvW9J67Q22vSMZO1umUS4DLY8wFY+b8=
go.dedis.ch/onet/v3 v3.0.31 h1:iVIAxP9Zy1dEsJzRbVAgVcWtbtEOC3KVWBW0yaUYX5k=
go.dedis.ch/onet/v3 v3.0.31/go.mod h1:P9R5g5BMoye1QvPVYY3LUmiq2YKodjgKfD2/nKDYosw=
go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRLo=
go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4=
go.dedis.ch/protobuf v1.0.8 h1:lmyHigYqVxoTN1V0adoGPvqSdjycAMK0XmTFjP893mA=
Expand All @@ -85,6 +87,7 @@ golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b h1:Elez2XeF2p9uyVj0yEUDqQ
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e h1:egKlR8l7Nu9vHGWbcUV8lqR4987UfUbBd7GbhqGzNYU=
golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac h1:8R1esu+8QioDxo4E4mX6bFztO+dMTM49DNAaWfO5OeY=
Expand All @@ -97,6 +100,7 @@ golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191021144547-ec77196f6094/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -107,6 +111,7 @@ golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 h1:ZBzSG/7F4eNKz2L3GE9o300RX0Az1Bw5HF7PDraD+qU=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
30 changes: 27 additions & 3 deletions services/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (s *Service) HandleSurveyDDTRequestTerms(sdq *SurveyDDTRequest) (network.Me
}

deterministicTaggingResult, execTime, communicationTime,
err := s.TaggingPhase(&request, &sdq.Roster)
err := s.TaggingPhase(&request, &sdq.Roster)
if err != nil {
log.Error(err)
return nil, err
Expand Down Expand Up @@ -440,12 +440,27 @@ func (s *Service) NewProtocol(tn *onet.TreeNodeInstance,
var target SurveyID
var protoConf ProtocolConfig

parent := "none"
if tn.Parent() != nil{
parent = tn.Parent().Name()
}
var children []string
for _, c := range tn.Children(){
children = append(children, c.Name())
}

log.Print(s.ServerIdentity(), tn.Info(), tn.Tree().Dump())
if conf != nil && conf.Data != nil {
protoConf, err = unmarshalProtocolConfig(conf.Data)
if err != nil {
return nil, err
}
target = protoConf.getTarget()
log.Print(s.ServerIdentity(), "got target for", target,
tn.ProtocolName(), tn.Roster().List, parent, children)
} else {
log.Print(s.ServerIdentity(), "no valid conf for", tn.ProtocolName(),
tn.Roster().List, parent, children)
}

switch tn.ProtocolName() {
Expand Down Expand Up @@ -552,11 +567,16 @@ func (s *Service) NewProtocol(tn *onet.TreeNodeInstance,

case protocolsunlynx.CollectiveAggregationProtocolName:
var surveyAgg SurveyAgg
for {
log.Print(s.ServerIdentity(), "SurveyAgg for:", target)
for i := 0; i < 5; i++ {
surveyAgg, err = s.getSurveyAgg(target)
if err != nil {
log.LLvl3(s.ServerIdentity(), "Waiting for data to arrive for survey", target)
time.Sleep(100 * time.Millisecond)
log.Print(s.ServerIdentity(), err)
if i == 4 {
log.Fatal(s.ServerIdentity(), "couldn't get surveyAgg")
}
time.Sleep(1000 * time.Millisecond)
} else {
break
}
Expand Down Expand Up @@ -638,6 +658,8 @@ func (s *Service) NewProtocol(tn *onet.TreeNodeInstance,
return nil, errors.New("Service attempts to start an unknown protocol: " + tn.ProtocolName() + ".")
}

log.Print(s.ServerIdentity(), "Setting conf to target:", target,
parent, children)
if err := tn.SetConfig(conf); err != nil {
log.Fatal(err)
return nil, err
Expand All @@ -660,6 +682,8 @@ func (s *Service) StartProtocol(name, typeQ string, pc ProtocolConfig,
if err != nil {
return nil, fmt.Errorf("couldn't get config: %+v", err)
}
log.Printf("%s: Config for %s: %+v", s.ServerIdentity(), pc.getTarget(),
conf)
pi, err := s.NewProtocol(tn, &conf)
if err != nil || pi == nil {
return nil, fmt.Errorf("couldn't start new protocol: %+v", err)
Expand Down

0 comments on commit 5e10dab

Please sign in to comment.