Skip to content

Commit

Permalink
ci: configure tests to run in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Sep 26, 2023
1 parent 8041359 commit efae429
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
shell: bash
run: sleep 45s

- name: Generate graphql types
- name: Generate Isolated Pools graphql types
run: |
docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run prepare:docker
docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run codegen
Expand All @@ -70,10 +70,23 @@ jobs:
sleep 5s
docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run generate-subgraph-types
- name: Run integration tests
- name: Run Isolated Pools integration integration tests
run: |
docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run test:integration
- name: Generate Governance graphql types
run: |
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run prepare:docker
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run codegen
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run create:docker
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run deploy:docker
sleep 5s
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run generate-subgraph-types
- name: Run Governance integration integration tests
run: |
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run test:integration
- name: Stop containers
if: always()
run: |
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/venus-governance/config/local.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"network": "bsc",
"network": "hardhat",
"accessControlManagerAddress": "0xc5a5C42992dECbae36851359345FE25997F5C42d",
"accessControlManagerStartBlock": "0",
"governorAlphaAddress": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
Expand Down
5 changes: 4 additions & 1 deletion subgraphs/venus-governance/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "venus-governance",
"name": "venus-governance-subgraph",
"version": "0.0.0",
"license": "MIT",
"repository": {
Expand All @@ -12,10 +12,13 @@
"scripts": {
"codegen": "graph codegen",
"create:local": "graph create venusprotocol/venus-governance --node http://127.0.0.1:8020",
"create:docker": "npx graph create venusprotocol/venus-governance --node http://graph-node:8020/",
"build:docker": "npx graph build --ipfs http://ipfs:5001",
"build:local": "graph build --ipfs http://localhost:5001",
"build:mainnet": "graph build --ipfs https://api.thegraph.com/ipfs/ ",
"deploy:integration": "graph deploy venusprotocol/venus-governance --debug --ipfs http://localhost:5001 --node http://127.0.0.1:8020/",
"deploy:local": "npx mustache config/local.json template.yaml > subgraph.yaml && yarn deploy:integration",
"deploy:docker": "npx mustache config/local.json template.yaml > subgraph.yaml && npx graph deploy venusprotocol/venus-governance --ipfs http://ipfs:5001 --node http://graph-node:8020/ --version-label ci",
"deploy:testnet": "npx mustache config/testnet.json template.yaml > subgraph.yaml && graph deploy venusprotocol/venus-governance-chapel --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy:mainnet": "npx mustache config/mainnet.json template.yaml > subgraph.yaml && graph deploy venusprotocol/venus-governance --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"prepare:local": "npx mustache config/local.json template.yaml > subgraph.yaml",
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/venus-governance/src/mappings/bravo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function handleProposalExecuted(event: ProposalExecuted): void {
updateProposalExecuted<ProposalExecuted>(event);
}

export function handleVoteCast(event: VoteCast): void {
export function handleBravoVoteCast(event: VoteCast): void {
createVoteBravo(event);
const proposalId = event.params.proposalId.toString();
const proposal = getProposal(proposalId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sources:
- name: venus-governance
handler:
graphql:
endpoint: http://127.0.0.1:8000/subgraphs/name/venusprotocol/venus-governance
endpoint: http://graph-node:8000/subgraphs/name/venusprotocol/venus-governance

documents:
- '../**/*.graphql'
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16881,9 +16881,9 @@ __metadata:
languageName: unknown
linkType: soft

"venus-governance@workspace:subgraphs/venus-governance":
"venus-governance-subgraph@workspace:subgraphs/venus-governance":
version: 0.0.0-use.local
resolution: "venus-governance@workspace:subgraphs/venus-governance"
resolution: "venus-governance-subgraph@workspace:subgraphs/venus-governance"
dependencies:
"@graphprotocol/client-cli": ^3.0.0
apollo-fetch: ^0.7.0
Expand Down

0 comments on commit efae429

Please sign in to comment.