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

Scratch Goth from tests #606

Merged
merged 79 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
117d580
chore: kick goth out and replace with docker-compose
cryptobench Sep 27, 2023
f1edc4f
chore: dont use arm builds for yagna
cryptobench Sep 27, 2023
99446a0
chore: bind GSB_URL and use custom subnet
cryptobench Sep 27, 2023
8d31368
chore: use correct dockerfile
cryptobench Sep 27, 2023
d4a5e6a
chore: run tests inside container
cryptobench Sep 29, 2023
0b144b0
chore: modify workflow to use docker instead of goth
cryptobench Oct 2, 2023
78e5bf3
Merge branch 'beta' into chore/scratch-goth
cryptobench Oct 2, 2023
19ef1bc
chore: test workflow
cryptobench Oct 2, 2023
c17f207
chore: skip default tests
cryptobench Oct 2, 2023
eb01600
chore: skip ci test
cryptobench Oct 2, 2023
bc4e6a1
chore: workflow fixes
cryptobench Oct 2, 2023
4db7559
chore: add workflow with no dependency
cryptobench Oct 2, 2023
7acfaee
chore: dont use tty for docker exec
cryptobench Oct 2, 2023
e70d7e6
chore: fund the requestor in workflow
cryptobench Oct 2, 2023
94f634c
chore: remove python from setup steps
cryptobench Oct 2, 2023
ee9bc18
chore: increase provider pricing for tests
cryptobench Oct 2, 2023
883adc1
chore: fix tests
cryptobench Oct 2, 2023
2a4d691
chore: update workflow to use docker
cryptobench Oct 2, 2023
943cf01
chore: build containers and then start to mitigate using same image
cryptobench Oct 2, 2023
eadef0c
chore: export subnet variable inside action
cryptobench Oct 2, 2023
dd2e102
chore: use proper syntax for env variables
cryptobench Oct 2, 2023
d38c961
chore: test cypress without goth
cryptobench Oct 2, 2023
8b76a53
chore: run cypress inside container
cryptobench Oct 2, 2023
5a2d810
chore: install cypress on start
cryptobench Oct 2, 2023
11c5c5d
chore: cypress fixes
cryptobench Oct 2, 2023
b629755
chore: fix cypress
cryptobench Oct 3, 2023
95c8f22
chore: use older rc with more net stability
cryptobench Oct 3, 2023
ebe23c4
chore: run examples test
cryptobench Oct 3, 2023
10cc4f4
chore: shutdown docker container before trying to start again
cryptobench Oct 3, 2023
9d5ac41
chore: revert aarch64
cryptobench Oct 3, 2023
bed099e
chore: test
cryptobench Oct 3, 2023
756e83a
chore: reorder test
cryptobench Oct 3, 2023
ae4d94a
chore: build on test:examples
cryptobench Oct 3, 2023
47d6b88
chore: test ts-node fix
cryptobench Oct 3, 2023
eb3f1e3
chore: try installing globally
cryptobench Oct 3, 2023
e1a48b7
chore: build in startup
cryptobench Oct 3, 2023
b9d0f9d
chore: use npm ci
cryptobench Oct 4, 2023
93fe767
chore: remove workaround that didnt work
cryptobench Oct 4, 2023
38035d5
chore: give my marcins idea a shot
cryptobench Oct 4, 2023
3671d4c
chore: double test timeouts not that were not using artificial env
cryptobench Oct 4, 2023
514dbac
chore: add option to exitOnError in examples test
cryptobench Oct 4, 2023
a4f9eb9
chore: increase the amount of providers
cryptobench Oct 4, 2023
dee83a5
chore: spawn custom whitelisted provider
cryptobench Oct 4, 2023
cfa9851
chore: uncomment providers
cryptobench Oct 4, 2023
124cfd1
chore: add missing kvm device
cryptobench Oct 4, 2023
4a8edb0
chore: continously fund the requestor
cryptobench Oct 4, 2023
7603f83
chore: disable polygon test
cryptobench Oct 4, 2023
a26924d
chore: use marcins fix for invoices
cryptobench Oct 4, 2023
647cdb5
chore: enable all tests for a full run
cryptobench Oct 4, 2023
9a91ff7
chore: retry funding 3 times before erroring out
cryptobench Oct 4, 2023
883e5f1
chore: rename whitelisted provider to provider to fix test
cryptobench Oct 4, 2023
4ba47e3
chore: double cypress timeout limit
cryptobench Oct 4, 2023
58419ee
chore: finish up release workflow
cryptobench Oct 5, 2023
0d407e3
chore: add back regular checks
cryptobench Oct 5, 2023
856fa5a
chore: remove no-goth option from package.json
cryptobench Oct 5, 2023
5acd5a2
chore: update README
cryptobench Oct 5, 2023
6f831c7
chore: remove provider logs
cryptobench Oct 5, 2023
c9dd112
chore: refactor all goth test actions
cryptobench Oct 5, 2023
1a9dca5
chore: update whitelist to use names instead of ids
cryptobench Oct 5, 2023
53321a7
chore: bump provider version
cryptobench Oct 5, 2023
63fb27c
chore: delete test file
cryptobench Oct 5, 2023
2aaff6e
chore: remove whitelisted providers
cryptobench Oct 5, 2023
0be725a
chore: revert jest timeout
cryptobench Oct 5, 2023
c21158c
chore: move everything docker related to its own directory
cryptobench Oct 5, 2023
1a222d5
chore: test changes
cryptobench Oct 5, 2023
e6e202b
chore: use new requestor name
cryptobench Oct 5, 2023
c86a60d
chore: use correct architecture for docker image
cryptobench Oct 5, 2023
68c8cc0
chore: test complete reverting ci
cryptobench Oct 5, 2023
682aa7b
chore: use 0.12.3
cryptobench Oct 6, 2023
2eb0da8
chore: increase cypress timeout due to failure
cryptobench Oct 6, 2023
98e645a
chore: increase timeouts in cypress even further
cryptobench Oct 6, 2023
f175919
chore: test rc-10 as cypress keeps timing out
cryptobench Oct 6, 2023
242073e
chore: reduce cypress timeouts again
cryptobench Oct 6, 2023
05a3cb5
Update README.md
cryptobench Oct 6, 2023
4ced309
chore: address marcins comments
cryptobench Oct 6, 2023
0e9bd0b
Merge branch 'chore/scratch-goth' of https://github.com/golemfactory/…
cryptobench Oct 6, 2023
af50042
chore: enable full workflow after green test
cryptobench Oct 6, 2023
85f36b9
chore: run on PR
cryptobench Oct 6, 2023
7507252
chore: release pipeline on push and ci on pull request
cryptobench Oct 6, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Regular CI Pipeline

on:
pull_request:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should remain "pull_request" for ci.yml because we want it to be run only on code which is "pull request to master" for example.

push:
branches:
# Regular release channels
- master
Expand Down
63 changes: 16 additions & 47 deletions .github/workflows/cypress-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,37 @@ on:

jobs:
cypress-tests:
runs-on: [goth2, ubuntu-22.10]
runs-on: goth2
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Use random string for subnet
run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Install browsers and graphic environment
run: |
sudo apt-get update -y
sudo apt-get install -y build-essential
sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install --allow-downgrades -y ./google-chrome-stable_current_amd64.deb
- name: Build the docker containers
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: docker compose -f tests/docker/docker-compose.yml build

- name: Build the SDK
run: |
npm install
npm run build
- name: Start the docker containers
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d

- name: Configure python
continue-on-error: true
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Fund the requestor
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 4 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"

- name: Install goth
- name: Install and build the SDK in the docker container
run: |
pip install goth
rm -rf ../goth/assets
python -m goth create-assets ../goth/assets
sed -Ezi 's/(use\-proxy:\s)(True)/\1False/mg' ../goth/assets/goth-config.yml
sed -Ezi 's/(use\-prerelease:\s)(false)/\1true\n release-tag: "0.13.0-rc10"/mg' ../goth/assets/goth-config.yml
sed -i '/^ENTRYPOINT/i ENV YAGNA_AUTOCONF_APPKEY=try_golem' ../goth/assets/docker/yagna-goth-deb.Dockerfile
- name: Cleanup Docker
if: always()
run: |
c=$(docker ps -q) && [[ $c ]] && docker kill $c
docker system prune -af
- name: Log in to GitHub Docker repository
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{github.actor}} --password-stdin
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build && ./node_modules/.bin/cypress install"
- name: Run web server
run: |
cd examples/web
node app.mjs &
docker exec -t -d docker-requestor-1 /bin/sh -c "cd /golem-js/examples/web && node app.mjs"
- name: Run test suite
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run test:cypress -- --browser chrome
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm run test:cypress -- --browser chromium"
- name: Upload test logs
uses: actions/upload-artifact@v2
Expand All @@ -75,11 +49,6 @@ jobs:
name: cypress-logs
path: .cypress

# Only relevant for self-hosted runners
- name: Remove test logs
if: always()
run: rm -rf .cypress

- name: Cleanup Docker
if: always()
run: |
Expand Down
65 changes: 16 additions & 49 deletions .github/workflows/examples-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: echo "::set-output name=matrix::{\"include\":[{\"branch\":\"master\"}]}"

goth-tests:
runs-on: [goth2, ubuntu-22.10]
runs-on: goth2
needs: prepare-matrix-master-only
strategy:
matrix: ${{ fromJson(needs.prepare-matrix-master-only.outputs.matrix-json) }}
Expand All @@ -31,61 +31,28 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Configure node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Use random string for subnet
run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Build golem-js
run: |
sudo apt-get update -y
sudo apt-get install -y build-essential
npm install
npm run build
npm install --prefix examples
npm install ts-node
- name: Build the docker containers
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: docker compose -f tests/docker/docker-compose.yml build

- name: Configure python
continue-on-error: true
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Start the docker containers
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d

- name: Install goth
run: |
pip install goth>=0.15.3
rm -rf ../goth/assets
python -m goth create-assets ../goth/assets
sed -Ezi 's/(use\-proxy:\s)(True)/\1False/mg' ../goth/assets/goth-config.yml
sed -Ezi 's/(use\-prerelease:\s)(false)/\1true\n release-tag: "0.13.0-rc21"/mg' ../goth/assets/goth-config.yml
sed -i '/^ENTRYPOINT/i ENV YAGNA_AUTOCONF_APPKEY=try_golem' ../goth/assets/docker/yagna-goth-deb.Dockerfile
- name: Fund the requestor
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 4 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"

- name: Cleanup Docker
if: always()
- name: Install and build the SDK in the docker container
run: |
c=$(docker ps -q) && [[ $c ]] && docker kill $c
docker system prune -af
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"
- name: Log in to GitHub Docker repository
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{github.actor}} --password-stdin

- name: Run test suite
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run the Examples tests
run: |
npm run test:examples
- name: Upload test logs
uses: actions/upload-artifact@v2
if: always()
with:
name: goth-logs
path: /tmp/goth-tests

# Only relevant for self-hosted runners
- name: Remove test logs
if: always()
run: rm -rf /tmp/goth-tests
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm install --prefix examples && npm install ts-node && npm run test:examples -- --exitOnError"
cryptobench marked this conversation as resolved.
Show resolved Hide resolved
- name: Cleanup Docker
if: always()
Expand Down
69 changes: 16 additions & 53 deletions .github/workflows/goth-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: echo "::set-output name=matrix::{\"include\":[{\"branch\":\"master\"}]}"

goth-tests:
runs-on: [goth2, ubuntu-22.10]
runs-on: goth2
needs: prepare-matrix-master-only
strategy:
matrix: ${{ fromJson(needs.prepare-matrix-master-only.outputs.matrix-json) }}
Expand All @@ -31,64 +31,27 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Configure node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Use random string for subnet
run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Build golem-js
run: |
sudo apt-get update -y
sudo apt-get install -y build-essential
npm install
npm run build
- name: Configure python
continue-on-error: true
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install goth
run: |
pip install goth
rm -rf ../goth/assets
python -m goth create-assets ../goth/assets
sed -Ezi 's/(use\-proxy:\s)(True)/\1False/mg' ../goth/assets/goth-config.yml
sed -Ezi 's/(use\-prerelease:\s)(false)/\1true\n release-tag: "0.13.0-rc10"/mg' ../goth/assets/goth-config.yml
- name: Build the docker containers
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: docker compose -f tests/docker/docker-compose.yml build

- name: Install websocat and sshpass
run: |
sudo wget https://github.com/vi/websocat/releases/download/v1.9.0/websocat_linux64 -O /usr/local/bin/websocat
sudo chmod +x /usr/local/bin/websocat
sudo apt-get install sshpass
- name: Cleanup Docker
if: always()
run: |
c=$(docker ps -q) && [[ $c ]] && docker kill $c
docker system prune -af
- name: Start the docker containers
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d

- name: Log in to GitHub Docker repository
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{github.actor}} --password-stdin
- name: Fund the requestor
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 4 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"

- name: Run test suite
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install and build the SDK in the docker container
run: |
npm run test:e2e
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"
- name: Upload test logs
uses: actions/upload-artifact@v2
if: always()
with:
name: goth-logs
path: /tmp/goth-tests

# Only relevant for self-hosted runners
- name: Remove test logs
if: always()
run: rm -rf /tmp/goth-tests
- name: Start the e2e test
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run test:e2e"
cryptobench marked this conversation as resolved.
Show resolved Hide resolved

- name: Cleanup Docker
if: always()
Expand Down
Loading
Loading