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

chore: add polkadotjs tests to ci #1567

Merged
merged 15 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 25 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,30 @@ jobs:
push: false
tags: chainsafe/gossamer:test
-
name: Run stress
name: Run grandpa
run: |
docker run chainsafe/gossamer:test sh -c "make it-grandpa"

docker-polkadotjs-tests:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
load: true
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: chainsafe/gossamer:test
-
name: Run polkadotjs tests
run: |
docker run chainsafe/gossamer:test sh -c "make it-polkadotjs"
17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ RUN apt-get update && \
apt-get install -y \
gcc \
cmake \
wget
wget \
curl \
npm

# Install node source for polkadotjs tests
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -

# Install nodejs for polkadotjs tests
RUN apt-get update && \
apt-get install -y \
nodejs

# Install Go
RUN wget https://dl.google.com/go/go1.15.5.linux-amd64.tar.gz
Expand Down Expand Up @@ -36,6 +46,9 @@ RUN go mod download
# Copy gossamer sources
COPY . $GOPATH/src/github.com/ChainSafe/gossamer

# Install js dependencies for polkadot.js tests
RUN cd $GOPATH/src/github.com/ChainSafe/gossamer/tests/polkadotjs_test && npm install

# Build
RUN GOBIN=$GOPATH/src/github.com/ChainSafe/gossamer/bin go run scripts/ci.go install

Expand All @@ -48,4 +61,4 @@ RUN chmod +x $GOPATH/src/github.com/ChainSafe/gossamer/scripts/docker-entrypoint
# Expose gossamer command and port
ENTRYPOINT ["/gocode/src/github.com/ChainSafe/gossamer/scripts/docker-entrypoint.sh"]
CMD ["/usr/local/gossamer"]
EXPOSE 7001
EXPOSE 7001 8546 8540
2 changes: 1 addition & 1 deletion tests/polkadotjs_test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@polkadot/api": "^3.11.1"
"@polkadot/api": "2.8.1"
},
"devDependencies": {
"chai": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/polkadotjs_test/start_polkadotjs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestStartGossamerAndPolkadotAPI(t *testing.T) {
command := "npx mocha ./test"
parts := strings.Fields(command)
data, err := exec.Command(parts[0], parts[1:]...).Output()
require.NoError(t, err, data)
require.NoError(t, err, fmt.Sprintf("%s", data))

//uncomment this to see log results from javascript tests
//fmt.Printf("%s\n", data)
Expand Down
2 changes: 1 addition & 1 deletion tests/polkadotjs_test/test/test-polkadot.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ describe('Testing polkadot.js/api calls:', function () {
});
});

});
});
Loading