-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Setup agnostic test stack #38
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
feat: Setup agnostic test stack #38
Conversation
- Introduced .dockerignore and Dockerfile for containerization. - Updated networks.json with new addresses and start blocks. - Enhanced package.json with new scripts for cleaning and managing the build process. - Created .gitignore for test-stack to exclude .env files. - Added docker-compose.yml to define services for the test environment. - Implemented prepare-test-env.js for dynamic environment variable generation. - Removed tsconfig.json as it is no longer needed.
…pose to use dynamic NETWORK_NAME for Ethereum service
- Added a new script to generate TypeChain types for ethers-v6 in package.json. - Updated the start-test-stack script to ensure proper environment setup. - Modified the itest script to include NETWORK_NAME in the environment. - Removed unused callHandlers from subgraph.yaml. - Enhanced docker-compose.yml to include a stack-ready service for better orchestration. - Updated prepare-test-env.js to conditionally update networks.json based on NETWORK_NAME. - Introduced tsconfig.json for TypeScript configuration with strict settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The integration test file has been modified because the forked test stack doesn’t index events at the time of PoCo deployment (need archieve node - too long - not recommended). The test stack only starts indexing once the stack is fully initialized. This is why we use typechains to trigger a transaction and verify that the corresponding event has been correctly indexed.
@@ -0,0 +1,15 @@ | |||
# iexec-poco-subgraph deployer | |||
|
|||
FROM node:20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference with ./docker/Dockerfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s the same. But according to Ugo, it’s better to move this file to root level for the GitHub Action CI. That’s why he also moved it to the root of the voucher subgraph repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add a comment at the top of the file to explain why we have both files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we should remove the one in ./docker/Dockerfile ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, as mentioned in the PR description, the Docker folder will be removed in another PR since the new Docker Compose is network-agnostic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use node 22 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All our repositories — voucher-subgraph, voucher-contract — are using Node 20.
I think we should stay consistent. But you’re right, we do need to move to Node 22.
Maybe we can discuss it during our Web3 daily.
* Remove obsolete Docker configurations, environment files, and subgraph definitions for bellecour, test, and viviani. Refactor unit tests for IexecCategoryManager and IexecPoco, consolidating mock utilities and event parameter builders into a unified structure.
* chore: update GitHub workflows for coverage, deployment, and testing * refactor: add formatting scripts and .prettierignore for code consistency * chore: update dependencies in package.json
🔒 Trivy Security Scan ResultsClick to expand detailed results
|
🔒 Trivy Security Scan ResultsClick to expand detailed results
|
🔒 Trivy Security Scan ResultsClick to expand detailed results
|
🔒 Trivy Security Scan ResultsClick to expand detailed results
|
* refactor: update CI workflow to include health checks and integration tests, remove obsolete Jenkinsfile * fix: update fork URL and block number retrieval in CI workflow * fix: update command options and environment variable retrieval in CI workflow * fix: correct health check options and update fork URL retrieval in CI workflow * fix: update IPFS image and health check commands in CI workflow * fix: update CI workflow to include genesis block retrieval and health checks for Graph Node * fix: update IPFS image to use kubo version in docker-compose * fix: retrieve fork URL and block number * fix: remove blockchain-fork service configuration from CI workflow * fix: update fetch block number to use static values and add IPFS readiness check * fix: remove code generation step from README * fix: remove unused services and streamline CI workflow * fix: update FORK_URL to use the correct endpoint for integration tests * fix: uncomment steps for installing dependencies, checking format, building, and running unit tests in CI workflow * fix: uncomment steps for preparing local stack environment and update FORK_BLOCK in test environment setup * fix: update fetch block step to source environment variables and use dynamic values for FORK_URL and FORK_BLOCK * fix: add NETWORK_NAME environment variable to prepare local stack environment step * fix: update fetch block step to source the correct environment file * fix: remove .idea directory from .gitignore * fix: reorder build step to occur before running unit tests * fix: reorder steps to run unit tests after build in CI workflow * fix: move NETWORK_NAME environment variable to the job level in CI workflow * Update test-stack/prepare-test-env.ts Co-authored-by: Zied Guesmi <26070035+zguesmi@users.noreply.github.com> * fix: update changelog for integration tests migration to GitHub Actions * fix: streamline test stack preparation in CI workflow (#46) * fix: remove NETWORK_NAME environment variable from job level in CI workflow * fix: update .env generation message in prepare-test-env script * fix: update integration test structure and add .env.template file * fix: add missing network configurations for avalancheFuji and arbitrumSepolia * fix: add Arbitrum & Avalanche network to changelog * fix: add dotenv and zod to package.json and package-lock.json; create env.ts for environment variable validation * fix: update test:unit script to include 'unit' argument for clarity * fix: update startBlock values and rename avalancheFuji to fuji in networks.json * feat: add Protocol entity to Core data source in subgraph.yaml * fix: update test:e2e script to specify test file pattern * fix: downgrade @graphprotocol/graph-ts to version 0.35.1 in package.json and package-lock.json * feat: add dotenv-cli dependency and update build scripts to use dotenv --------- Co-authored-by: Ugo Mignon <ugo.mignon@gameverse.app> Co-authored-by: Zied Guesmi <26070035+zguesmi@users.noreply.github.com>
🔒 Trivy Security Scan ResultsClick to expand detailed results
|
TODO in a next PR :
docker
folder & dead files : Remove unused files #42env.template
file with Zod validation : fix: Fix Subgraph deployment #47format
andcheck-format
scripts : feature/refactor-ci #43subgraph.template.yml
file : Remove unused files #42