Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9e4ac65
refactor: update CI workflow to include health checks and integration…
Le-Caignec Apr 24, 2025
85a202f
fix: update fork URL and block number retrieval in CI workflow
Le-Caignec Apr 24, 2025
3076c4f
fix: update command options and environment variable retrieval in CI …
Le-Caignec Apr 24, 2025
315e600
fix: correct health check options and update fork URL retrieval in CI…
Le-Caignec Apr 24, 2025
c11ac45
fix: update IPFS image and health check commands in CI workflow
Le-Caignec Apr 24, 2025
8fed9da
fix: update CI workflow to include genesis block retrieval and health…
TartanLeGrand Apr 24, 2025
c4451d0
fix: update IPFS image to use kubo version in docker-compose
Le-Caignec Apr 24, 2025
8656831
fix: retrieve fork URL and block number
TartanLeGrand Apr 24, 2025
2041a68
fix: remove blockchain-fork service configuration from CI workflow
TartanLeGrand Apr 24, 2025
bc85f68
fix: update fetch block number to use static values and add IPFS read…
Le-Caignec Apr 24, 2025
7f171a4
Merge branch 'feature/migrate-integration-tests' of https://github.co…
Le-Caignec Apr 24, 2025
52ca2ae
fix: remove code generation step from README
Le-Caignec Apr 24, 2025
c41a006
fix: remove unused services and streamline CI workflow
Le-Caignec Apr 24, 2025
4ec3980
fix: update FORK_URL to use the correct endpoint for integration tests
Le-Caignec Apr 24, 2025
52e0101
fix: uncomment steps for installing dependencies, checking format, bu…
Le-Caignec Apr 24, 2025
9bcffbc
fix: uncomment steps for preparing local stack environment and update…
Le-Caignec Apr 24, 2025
c3bed0b
fix: update fetch block step to source environment variables and use …
Le-Caignec Apr 24, 2025
e5999ae
fix: add NETWORK_NAME environment variable to prepare local stack env…
Le-Caignec Apr 24, 2025
51761db
fix: update fetch block step to source the correct environment file
Le-Caignec Apr 24, 2025
9e17544
fix: remove .idea directory from .gitignore
Le-Caignec Apr 24, 2025
a20ad2d
fix: reorder build step to occur before running unit tests
Le-Caignec Apr 24, 2025
32f7059
fix: reorder steps to run unit tests after build in CI workflow
Le-Caignec Apr 24, 2025
2ee27cd
fix: move NETWORK_NAME environment variable to the job level in CI wo…
Le-Caignec Apr 24, 2025
d9c8167
Update test-stack/prepare-test-env.ts
Le-Caignec Apr 25, 2025
b660ee1
fix: update changelog for integration tests migration to GitHub Actions
Le-Caignec Apr 25, 2025
124a15b
fix: streamline test stack preparation in CI workflow (#46)
Le-Caignec Apr 25, 2025
cebad13
fix: remove NETWORK_NAME environment variable from job level in CI wo…
Le-Caignec Apr 25, 2025
874e4c0
fix: update .env generation message in prepare-test-env script
Le-Caignec Apr 25, 2025
b0dbad0
fix: update integration test structure and add .env.template file
Le-Caignec Apr 25, 2025
2abc3a3
fix: add missing network configurations for avalancheFuji and arbitru…
Le-Caignec Apr 25, 2025
93167f9
fix: add Arbitrum & Avalanche network to changelog
Le-Caignec Apr 25, 2025
e6b89e2
fix: add dotenv and zod to package.json and package-lock.json; create…
Le-Caignec Apr 25, 2025
71a8ab6
Merge remote-tracking branch 'origin/feature/setup-agnostique-test-st…
Le-Caignec Apr 25, 2025
d5b0af5
fix: update test:unit script to include 'unit' argument for clarity
Le-Caignec Apr 25, 2025
d01ddc4
fix: update startBlock values and rename avalancheFuji to fuji in net…
Le-Caignec Apr 27, 2025
ebbf753
feat: add Protocol entity to Core data source in subgraph.yaml
Le-Caignec Apr 28, 2025
814adf6
fix: update test:e2e script to specify test file pattern
Le-Caignec Apr 28, 2025
fdaac23
fix: downgrade @graphprotocol/graph-ts to version 0.35.1 in package.j…
Le-Caignec Apr 28, 2025
324dd4c
feat: add dotenv-cli dependency and update build scripts to use dotenv
Le-Caignec Apr 28, 2025
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
11 changes: 11 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The name of the network (e.g., mainnet, arbitrum, etc.)
NETWORK_NAME=...

# The URL of the Graph Node endpoint for self-hosted Graph Node
GRAPHNODE_URL=...

# The URL of the IPFS endpoint for self-hosted IPFS
IPFS_URL=...

# The version label for the deployment (e.g., v1.0.0)
VERSION_LABEL=...
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ subgraph.test.yaml
test-stack/.env
tests/.bin
tests/.latest.json
.env
1 change: 0 additions & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"extension": ["ts"],
"spec": "itest/**/*.ts",
"require": ["ts-node/register"],
"timeout": 1000000,
"node-option": [
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## vNEXT

- Add Arbitrum & Avalanche networks. (#47)
- Migrate integration tests from Jenkins to GitHub Actions. (#44)
- Remove unused files to streamline the repository. (#42)
- Rewrite Jenkins CI for future migration (#36, #37)
Expand Down
17 changes: 17 additions & 0 deletions config/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'dotenv/config';
import { z } from 'zod';

const envSchema = z.object({
NETWORK_NAME: z.string().min(1, 'NETWORK_NAME is required').default('bellecour'),

GRAPHNODE_URL: z
.string()
.url('GRAPHNODE_URL must be a valid URL')
.default('http://localhost:8020'),

IPFS_URL: z.string().url('IPFS_URL must be a valid URL').default('http://localhost:5001'),

VERSION_LABEL: z.string().min(1, 'VERSION_LABEL is required').default('bellecour/poco-v5'),
});

export const env = envSchema.parse(process.env);
44 changes: 44 additions & 0 deletions networks.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,48 @@
{
"fuji": {
"ERC1538": {
"address": "0x14B465079537655E1662F012e99EBa3863c8B9E0",
"startBlock": 39496461
},
"Core": {
"address": "0x14B465079537655E1662F012e99EBa3863c8B9E0",
"startBlock": 39496461
},
"AppRegistry": {
"address": "0x4a6531ce5150ee716b2d93865D0fbB9ce5492D17",
"startBlock": 39496461
},
"DatasetRegistry": {
"address": "0x3441A0C9FE488c51fcABa2bAAA048720f4D4F72D",
"startBlock": 39496461
},
"WorkerpoolRegistry": {
"address": "0xf81970E3CB0f8711bEaA79135e686873FfbBAC4A",
"startBlock": 39496461
}
},
"arbitrum-sepolia": {
"ERC1538": {
"address": "0x14B465079537655E1662F012e99EBa3863c8B9E0",
"startBlock": 145249746
},
"Core": {
"address": "0x14B465079537655E1662F012e99EBa3863c8B9E0",
"startBlock": 145249746
},
"AppRegistry": {
"address": "0x4a6531ce5150ee716b2d93865D0fbB9ce5492D17",
"startBlock": 145249746
},
"DatasetRegistry": {
"address": "0x3441A0C9FE488c51fcABa2bAAA048720f4D4F72D",
"startBlock": 145249746
},
"WorkerpoolRegistry": {
"address": "0xf81970E3CB0f8711bEaA79135e686873FfbBAC4A",
"startBlock": 145249746
}
},
"bellecour": {
"ERC1538": {
"address": "0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f",
Expand Down
98 changes: 76 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"scripts": {
"prepare": "husky",
"generate:typechain": "typechain --target ethers-v6 --out-dir generated/typechain './node_modules/@iexec/poco/build/contracts/*.json' --ts-nocheck",
"build": "rm -rf generated && rm -rf build && npm run generate:typechain && graph codegen && graph build --network ${NETWORK_NAME:-bellecour}",
"build": "dotenv -e .env -- rm -rf generated && rm -rf build && npm run generate:typechain && graph codegen && graph build --network ${NETWORK_NAME:-bellecour}",
"test": "npm run test:unit && npm run test:e2e",
"test:unit": "graph test",
"test:e2e": "NETWORK_NAME=${NETWORK_NAME:-bellecour} mocha",
"test:unit": "graph test unit",
"test:e2e": "mocha tests/e2e/**/*.ts",
"coverage": "graph test -- -c",
"create": "graph create ${NETWORK_NAME:-bellecour}/poco --node ${GRAPHNODE_URL:-http://localhost:8020}",
"deploy": "graph deploy ${NETWORK_NAME:-bellecour}/poco --node ${GRAPHNODE_URL:-http://localhost:8020} --ipfs ${IPFS_URL:-http://localhost:5001} --version-label ${VERSION_LABEL:-bellecour/poco-v5}",
"create": "dotenv -e .env -- graph create ${NETWORK_NAME:-bellecour}/poco --node ${GRAPHNODE_URL:-http://localhost:8020}",
"deploy": "dotenv -e .env -- graph deploy ${NETWORK_NAME:-bellecour}/poco --node ${GRAPHNODE_URL:-http://localhost:8020} --ipfs ${IPFS_URL:-http://localhost:5001} --version-label ${VERSION_LABEL:-bellecour/poco-v5}",
"all": "npm run build && npm run create && npm run deploy",
"stop-test-stack": "cd test-stack && docker compose down --remove-orphans --volumes",
"start-test-stack": "npm run stop-test-stack && cd test-stack && export NETWORK_NAME=${NETWORK_NAME:-bellecour} && tsx prepare-test-env.ts && docker compose build && docker compose up -d",
Expand All @@ -36,9 +36,11 @@
"devDependencies": {
"@apollo/client": "^3.11.8",
"@graphprotocol/graph-cli": "^0.96.0",
"@graphprotocol/graph-ts": "^0.38.0",
"@graphprotocol/graph-ts": "0.35.1",
"@typechain/ethers-v6": "^0.5.1",
"@types/mocha": "^10.0.9",
"dotenv": "^16.5.0",
"dotenv-cli": "^8.0.0",
"ethers": "^6.13.5",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
Expand All @@ -48,7 +50,8 @@
"prettier-plugin-organize-imports": "^4.1.0",
"testcontainers": "^10.13.2",
"ts-node": "^10.9.2",
"tsx": "^4.19.3"
"tsx": "^4.19.3",
"zod": "^3.24.3"
},
"dependencies": {
"@iexec/poco": "^5.5.0",
Expand Down
1 change: 1 addition & 0 deletions subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dataSources:
language: wasm/assemblyscript
entities:
- Category
- Protocol
- Account
- AppOrder
- DatasetOrder
Expand Down
9 changes: 5 additions & 4 deletions itest/integration.test.ts → tests/e2e/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import { InMemoryCache } from '@apollo/client/cache';
import { ApolloClient, gql } from '@apollo/client/core';
import { equal } from 'assert';
import { JsonRpcProvider, Wallet, ZeroHash } from 'ethers';
import { AppRegistry__factory, IexecInterfaceToken__factory } from '../generated/typechain';
import config from '../networks.json' with { type: 'json' };
import { env } from '../../config/env';
import { AppRegistry__factory, IexecInterfaceToken__factory } from '../../generated/typechain';
import config from '../../networks.json' with { type: 'json' };

const APIURL = `http://localhost:8000/subgraphs/name/${process.env.NETWORK_NAME}/poco`;
const APIURL = `http://localhost:8000/subgraphs/name/${env.NETWORK_NAME}/poco`;
const client = new ApolloClient({
uri: APIURL,
cache: new InMemoryCache(),
});
const networkName = process.env.NETWORK_NAME!;
const networkName = env.NETWORK_NAME!;
const iexecProxyAddress = (config as any)[networkName].ERC1538.address;

describe('Integration tests', () => {
Expand Down