From 79af1824e36c087f83faa1f6082cc8849bd58873 Mon Sep 17 00:00:00 2001 From: samay-kothari <2001samay@gmail.com> Date: Sun, 27 Feb 2022 00:43:34 +0530 Subject: [PATCH 1/6] tried fixing the issue with the github tests --- .github/workflows/go.yml | 112 +++++++++++++++++++++++++++++++++++---- 1 file changed, 103 insertions(+), 9 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 449ea087..1cd8fbb9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -49,25 +49,119 @@ jobs: cd $GOPATH/src/github.com/${{ github.repository }}/cmd/utreexoclient go build -v - - name: Run unit tests + - name: Upload testdata + uses: actions/upload-artifact@v2 + with: + name: testdatapath + path: "${{ github.workspace }}/testdatapath" + + run-unit-tests: + name: Run Unit Tests + runs-on: ubuntu-latest + needs: Build + timeout-minutes: 5 + steps: + - name: setup directory + shell: bash + run: | + mkdir -p "${{ github.workspace }}/testdatapath" + + # set GOPATH + - name: setup env shell: bash + run: | + echo "${{ github.workspace }}/go/bin:" >> $GITHUB_PATH + echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV + + - name: Install Go + if: success() + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go + + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + path: go/src/github.com/${{ github.repository }} + + - name: Get dependencies run: | cd $GOPATH/src/github.com/${{ github.repository }} - go test -v ./accumulator + go get -v -d ./... - - name: Run integration tests + - name: Build + shell: bash + run: | + cd $GOPATH/src/github.com/${{ github.repository }}/cmd/utreexoserver + go build -v + + - name: Build + shell: bash + run: | + cd $GOPATH/src/github.com/${{ github.repository }}/cmd/utreexoclient + go build -v + - name: tests shell: bash run: | cd $GOPATH/src/github.com/${{ github.repository }} - ./test/install_bitcoind.sh - ./test/csn_bridge.sh "./cmd/utreexoserver/utreexoserver" "./cmd/utreexoclient/utreexoclient" "${{ github.workspace }}/testdatapath" + go test -v ./accumulator - - name: Upload testdata - uses: actions/upload-artifact@v2 + run-integration-tests: + name: Run Integration Tests + runs-on: ubuntu-latest + needs: Build + timeout-minutes: 5 + steps: + - name: setup directory + shell: bash + run: | + mkdir -p "${{ github.workspace }}/testdatapath" + + # set GOPATH + - name: setup env + shell: bash + run: | + echo "${{ github.workspace }}/go/bin:" >> $GITHUB_PATH + echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV + + - name: Install Go + if: success() + uses: actions/setup-go@v1 with: - name: testdatapath - path: "${{ github.workspace }}/testdatapath" + go-version: 1.13 + id: go + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + path: go/src/github.com/${{ github.repository }} + + - name: Get dependencies + run: | + cd $GOPATH/src/github.com/${{ github.repository }} + go get -v -d ./... + + - name: Build + shell: bash + run: | + cd $GOPATH/src/github.com/${{ github.repository }}/cmd/utreexoserver + go build -v + + - name: Build + shell: bash + run: | + cd $GOPATH/src/github.com/${{ github.repository }}/cmd/utreexoclient + go build -v + - name: integration tests + shell: bash + run: | + cd $GOPATH/src/github.com/${{ github.repository }} + ./test/install_bitcoind.sh + ./test/csn_bridge.sh "./cmd/utreexoserver/utreexoserver" "./cmd/utreexoclient/utreexoclient" "${{ github.workspace }}/testdatapath" + check-proof-backwards: name: Check proof backwards compatibility runs-on: ubuntu-latest From 50c98e0e51c80d9229c98e152f2aec1af61508a5 Mon Sep 17 00:00:00 2001 From: samay-kothari <2001samay@gmail.com> Date: Sun, 27 Feb 2022 01:18:17 +0530 Subject: [PATCH 2/6] tried to fix Fuzz testing --- accumulator/fuzz.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/accumulator/fuzz.go b/accumulator/fuzz.go index 3306062f..0b9c4318 100644 --- a/accumulator/fuzz.go +++ b/accumulator/fuzz.go @@ -12,10 +12,14 @@ import ( func undoOnceFuzzy(data *bytes.Buffer) error { f := NewForest(RamForest, nil, "", 0) - seed0, err := data.ReadByte(); - if err != nil { return nil } - seed1, err := data.ReadByte(); - if err != nil { return nil } + seed0, err := data.ReadByte() + if err != nil { + return nil + } + seed1, err := data.ReadByte() + if err != nil { + return nil + } seed := (int64(seed1) << 8) | int64(seed0) sc := newSimChainWithSeed(0x07, seed) if sc == nil { @@ -35,7 +39,7 @@ func undoOnceFuzzy(data *bytes.Buffer) error { if err != nil { return err } - beforeRoot := f.getRoots() + beforeRoot := f.GetRoots() ub, err := f.Modify(adds, bp.Targets) if err != nil { return err @@ -52,7 +56,7 @@ func undoOnceFuzzy(data *bytes.Buffer) error { return err } sc.BackOne(adds, durations, delHashes) - afterRoot := f.getRoots() + afterRoot := f.GetRoots() if !reflect.DeepEqual(beforeRoot, afterRoot) { return fmt.Errorf("undo mismatch") } From d0d54c64d7f6d2f4ac9880d62ba987134374efbb Mon Sep 17 00:00:00 2001 From: samay-kothari <2001samay@gmail.com> Date: Fri, 4 Mar 2022 23:17:09 +0530 Subject: [PATCH 3/6] uploading test data before downloading --- .github/workflows/go.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1cd8fbb9..8ff2b314 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -174,10 +174,18 @@ jobs: run: | echo "${{ github.workspace }}/go/bin:" >> $GITHUB_PATH echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV + + - name: Upload testdata + uses: actions/upload-artifact@v2 + with: + name: testdatapath + path: "${{ github.workspace }}/testdatapath" - - uses: actions/download-artifact@v2 + - name: Get TestDataPath + uses: actions/download-artifact@v2 with: name: testdatapath + path: "${{ github.workspace }}/testdatapath" - name: Install Go if: success() From 62d8b9f0db991056f488e15ea91c8463990baba5 Mon Sep 17 00:00:00 2001 From: samay-kothari <2001samay@gmail.com> Date: Fri, 4 Mar 2022 23:27:26 +0530 Subject: [PATCH 4/6] uploading test data in the test jobs --- .github/workflows/go.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8ff2b314..22a8e5a3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -49,14 +49,9 @@ jobs: cd $GOPATH/src/github.com/${{ github.repository }}/cmd/utreexoclient go build -v - - name: Upload testdata - uses: actions/upload-artifact@v2 - with: - name: testdatapath - path: "${{ github.workspace }}/testdatapath" run-unit-tests: - name: Run Unit Tests + name: Unit Tests runs-on: ubuntu-latest needs: Build timeout-minutes: 5 @@ -108,8 +103,14 @@ jobs: cd $GOPATH/src/github.com/${{ github.repository }} go test -v ./accumulator + - name: Upload testdata + uses: actions/upload-artifact@v2 + with: + name: testdatapath + path: "${{ github.workspace }}/testdatapath" + run-integration-tests: - name: Run Integration Tests + name: Integration Tests runs-on: ubuntu-latest needs: Build timeout-minutes: 5 @@ -161,11 +162,17 @@ jobs: cd $GOPATH/src/github.com/${{ github.repository }} ./test/install_bitcoind.sh ./test/csn_bridge.sh "./cmd/utreexoserver/utreexoserver" "./cmd/utreexoclient/utreexoclient" "${{ github.workspace }}/testdatapath" + + - name: Upload testdata + uses: actions/upload-artifact@v2 + with: + name: testdatapath + path: "${{ github.workspace }}/testdatapath" check-proof-backwards: name: Check proof backwards compatibility runs-on: ubuntu-latest - needs: Build + needs: Build, Unit Tests timeout-minutes: 5 steps: # set GOPATH @@ -175,11 +182,6 @@ jobs: echo "${{ github.workspace }}/go/bin:" >> $GITHUB_PATH echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV - - name: Upload testdata - uses: actions/upload-artifact@v2 - with: - name: testdatapath - path: "${{ github.workspace }}/testdatapath" - name: Get TestDataPath uses: actions/download-artifact@v2 From 83bab8753447ea895f11135b1b6c08149f233b6f Mon Sep 17 00:00:00 2001 From: samay-kothari <2001samay@gmail.com> Date: Fri, 4 Mar 2022 23:33:17 +0530 Subject: [PATCH 5/6] error in github workflow file --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 22a8e5a3..ea728f6b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -172,7 +172,7 @@ jobs: check-proof-backwards: name: Check proof backwards compatibility runs-on: ubuntu-latest - needs: Build, Unit Tests + needs: Unit Tests timeout-minutes: 5 steps: # set GOPATH From db736e640e2076a573cf77e9f094f8510154cb6a Mon Sep 17 00:00:00 2001 From: samay-kothari <2001samay@gmail.com> Date: Fri, 4 Mar 2022 23:35:23 +0530 Subject: [PATCH 6/6] error in github workflow file --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ea728f6b..7224cae8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -172,7 +172,7 @@ jobs: check-proof-backwards: name: Check proof backwards compatibility runs-on: ubuntu-latest - needs: Unit Tests + needs: run-unit-tests timeout-minutes: 5 steps: # set GOPATH