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

Test flow with Ocean Node #49

Merged
merged 40 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
087b640
Setting up test flow + adding codeowners + adding .nvmrc
jamiehewitt15 May 29, 2024
eacef33
Updating github actions test flow
jamiehewitt15 May 29, 2024
53ce188
Setting up esLint
jamiehewitt15 May 29, 2024
2d1bc18
Fixing eslint errors
jamiehewitt15 May 29, 2024
72c70b0
Fixing dependancy conflict
jamiehewitt15 May 29, 2024
f9a86f4
Adding workflow for starting barge & ocean node
jamiehewitt15 May 29, 2024
9500d6a
Updating the ci workflow
jamiehewitt15 May 29, 2024
4e43326
Updating github actions flow
jamiehewitt15 May 29, 2024
88923b9
pull from origin main
jamiehewitt15 May 30, 2024
b8758bc
Updating ocean-node setup including the envs
jamiehewitt15 Jun 3, 2024
cf441b8
Adding test for ocean node root endpoint
jamiehewitt15 Jun 3, 2024
6bfa705
Updating CI to run tests
jamiehewitt15 Jun 3, 2024
11067da
Updating packages
jamiehewitt15 Jun 3, 2024
d6e9671
Updating depedanices for tests
jamiehewitt15 Jun 3, 2024
89fa119
Updating dependancies and getting the tests to run
jamiehewitt15 Jun 4, 2024
76b141b
FIxing linting
jamiehewitt15 Jun 4, 2024
8558308
Updating test command in the CI
jamiehewitt15 Jun 4, 2024
dafe330
Fixing linting
jamiehewitt15 Jun 4, 2024
4f920d1
Checking if ocean node is up and running before starting the tests
jamiehewitt15 Jun 4, 2024
4fbcfd5
Updating CI to checkout develop branch on occean-node git repo
jamiehewitt15 Jun 4, 2024
2d0f053
Updating CI
jamiehewitt15 Jun 4, 2024
f1e626c
Updating the CI
jamiehewitt15 Jun 4, 2024
dfe685e
Adding more detailed test of the root endpooint
jamiehewitt15 Jun 4, 2024
cf1f317
Adding test for the direct command status endpoint
jamiehewitt15 Jun 4, 2024
9a66e01
Adding test for getOceanPeers endpoint
jamiehewitt15 Jun 4, 2024
077bead
Adding test for Logs endpoint
jamiehewitt15 Jun 4, 2024
b36a3b8
Testing the CLI directly
jamiehewitt15 Jun 4, 2024
1226e60
Adding full tests for the setup of ocean-cli
jamiehewitt15 Jun 6, 2024
4964b19
Adding test for publish
jamiehewitt15 Jun 6, 2024
e70ccee
Publishing py and js algorithms
jamiehewitt15 Jun 6, 2024
8df7c04
running cli getDDO command for both algorithms and both datasets
jamiehewitt15 Jun 10, 2024
d9c366d
Updating envs in CI
jamiehewitt15 Jun 11, 2024
229da9f
Updating CI
jamiehewitt15 Jun 11, 2024
acc5649
CI fix
jamiehewitt15 Jun 11, 2024
3a579b3
Download test
jamiehewitt15 Jun 11, 2024
ec3f03b
Removing temporary file
jamiehewitt15 Jun 11, 2024
3bffda2
Updating tests
jamiehewitt15 Jun 11, 2024
9cd5434
Removing temporary file
jamiehewitt15 Jun 11, 2024
79fa60c
pulling from origin main
jamiehewitt15 Jun 20, 2024
31887d8
Updating tests
jamiehewitt15 Jun 25, 2024
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @alexcos20 @bogdanfazakas @jamiehewitt15 @mariacarmina @paulo-ocean
158 changes: 158 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Test Flow

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Run build
run: npm run build

lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Run lint
run: npm run lint

test_system:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18.19.0'

- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-test-integration-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-test-integration-${{ env.cache-name }}-

- name: Set ADDRESS_FILE
run: echo "ADDRESS_FILE=${HOME}/.ocean/ocean-contracts/artifacts/address.json" >> $GITHUB_ENV

- name: Checkout Barge
uses: actions/checkout@v3
with:
repository: 'oceanprotocol/barge'
path: 'barge'
ref: 'feature/nodes'

- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_PASSWORD && env.DOCKERHUB_USERNAME }}
run: |
echo "Login to Docker Hub"
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Run Barge
working-directory: ${{ github.workspace }}/barge
run: |
bash -x start_ocean.sh --no-dashboard --with-c2d 2>&1 > start_ocean.log &

- run: npm ci
- run: npm run build
- run: docker image ls
- name: Delete default runner images
run: |
docker image rm node:20
docker image rm node:20-alpine
docker image rm node:18
docker image rm node:18-alpine
docker image rm node:16
docker image rm node:16-alpine
docker image rm debian:10
docker image rm debian:11
docker image rm ubuntu:22.04
docker image rm ubuntu:20.04
docker image rm moby/buildkit:latest
rm -rf /usr/share/swift/

- name: Wait for contracts deployment and C2D cluster to be ready
working-directory: ${{ github.workspace }}/barge
run: |
for i in $(seq 1 250); do
sleep 10
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" -a -f "$HOME/.ocean/ocean-c2d/ready" ] && break
done

- name: docker logs
run: docker logs ocean_ocean-contracts_1 && docker logs ocean_kindcluster_1 && docker logs ocean_computetodata_1 && docker logs ocean_typesense_1
if: ${{ failure() }}

- name: Checkout Ocean Node
uses: actions/checkout@v3
with:
repository: 'oceanprotocol/ocean-node'
path: 'ocean-node'
ref: 'develop'

- name: Start Ocean Node
working-directory: ${{ github.workspace }}/ocean-node
run: |
npm ci
npm run build
npm run start &
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
IPFS_GATEWAY: http://172.15.0.16:8080/
ARWEAVE_GATEWAY: https://arweave.net/
P2P_ipV4BindTcpPort: 8000
HTTP_API_PORT: 8001
RPCS: '{ "8996": {"rpc": "http://127.0.0.1:8545", "chainId": 8996, "network": "development", "chunkSize": 100} }'
DB_URL: 'http://localhost:8108/?apiKey=xyz'
FEE_TOKENS: '{ "1": "0x967da4048cD07aB37855c090aAF366e4ce1b9F48", "137": "0x282d8efCe846A88B159800bd4130ad77443Fa1A1", "80001": "0xd8992Ed72C445c35Cb4A2be468568Ed1079357c8", "56": "0xDCe07662CA8EbC241316a15B611c89711414Dd1a" }'
FEE_AMOUNT: '{ "amount": 1, "unit": "MB" }'
AUTHORIZED_DECRYPTERS: '["0xe2DD09d719Da89e5a3D0F2549c7E24566e947260"]'
ALLOWED_ADMINS: '["0xe2DD09d719Da89e5a3D0F2549c7E24566e947260"]'
- name: Check Ocean Node is running
run: |
for i in $(seq 1 30); do
if curl --output /dev/null --silent --head --fail "http://localhost:8001"; then
echo "Ocean Node is up"
exit 0
fi
sleep 10
done
echo "Ocean Node did not start in time"
exit 1
- name: Run system tests
run: npm run test:system

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.19.0
13 changes: 13 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";


export default [
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{rules: {
'@typescript-eslint/no-explicit-any': 'warn',
}}
];
Loading
Loading