-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into scroll-2837
- Loading branch information
Showing
87 changed files
with
23,654 additions
and
9,180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ node_modules | |
dist/ | ||
coverage/ | ||
.eslintcache | ||
|
||
bun.lockb | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,87 @@ | ||
version: '3.8' | ||
|
||
# Ports | ||
# Dev chain 1: 8545 | ||
# Dev chain 2: 8546 | ||
# Builder: 3000 | ||
# Explorer: 3001 | ||
# Manager: 3002 | ||
# Pinata: 3003 | ||
# Indexer: 3004 | ||
# Dev chain 1: 3005 | ||
# Subgraph dev chain 1: 3006 | ||
# Dev chain 2: 3007 | ||
# Subgraph dev chain 2: 3008 | ||
|
||
services: | ||
pinata: | ||
pina: | ||
image: ghcr.io/gitcoinco/pina:main | ||
networks: | ||
- grants-stack | ||
|
||
ports: | ||
- '127.0.0.1:3003:8000' | ||
|
||
localchain-1: | ||
image: ghcr.io/gitcoinco/allo-contracts-v1:main | ||
local-chain-1: | ||
image: ghcr.io/foundry-rs/foundry:nightly-b174c3a4f80938636f18b3c9e49d45e6643f64a9 | ||
networks: | ||
- grants-stack | ||
ports: | ||
- '127.0.0.1:3005:8545' | ||
- '127.0.0.1:8545:8545' | ||
environment: | ||
- DEV_CHAIN_ID=313371 | ||
entrypoint: ["anvil", "--host", "0.0.0.0", "--chain-id", "313371"] | ||
|
||
# initializes localchain deploying contracts and populates with test data | ||
dev-setup-1: | ||
image: ghcr.io/gitcoinco/allo-contracts-v1:main | ||
depends_on: | ||
- pinata | ||
- localchain-1 | ||
local-chain-2: | ||
image: ghcr.io/foundry-rs/foundry:nightly-b174c3a4f80938636f18b3c9e49d45e6643f64a9 | ||
networks: | ||
- grants-stack | ||
ports: | ||
- '127.0.0.1:8546:8545' | ||
environment: | ||
- PINATA_HOST=pinata | ||
- PINATA_PORT=8000 | ||
- DEV_CHAIN_HOST=localchain-1 | ||
- DEV_CHAIN_ID=313371 | ||
restart: "no" | ||
entrypoint: [ "bash", "-c", "sleep 2 && corepack enable && exec ./docker/deploy-contracts.sh"] | ||
- DEV_CHAIN_ID=313372 | ||
entrypoint: ["anvil", "--host", "0.0.0.0", "--chain-id", "313372"] | ||
|
||
localchain-2: | ||
image: ghcr.io/gitcoinco/allo-contracts-v1:pr-1 | ||
indexer-db: | ||
image: postgres:13 | ||
networks: | ||
- grants-stack | ||
ports: | ||
- '127.0.0.1:3007:8545' | ||
- "127.0.0.1:5432:5432" | ||
environment: | ||
- DEV_CHAIN_ID=313372 | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_DB=postgres | ||
|
||
# initializes localchain deploying contracts and populates with test data | ||
dev-setup-2: | ||
image: ghcr.io/gitcoinco/allo-contracts-v1:pr-1 | ||
indexer: | ||
image: ghcr.io/gravityblast/grants-stack-indexer:main | ||
networks: | ||
- grants-stack | ||
ports: | ||
- '127.0.0.1:3004:4000' | ||
depends_on: | ||
- pinata | ||
- localchain-2 | ||
- indexer-db | ||
- pina | ||
- local-chain-1 | ||
- local-chain-2 | ||
volumes: | ||
- ./tmp/indexer/passport_scores.leveldb:/var/indexer/passport_scores.leveldb | ||
environment: | ||
- PINATA_HOST=pinata | ||
- PINATA_PORT=8000 | ||
- DEV_CHAIN_HOST=localchain-2 | ||
- DEV_CHAIN_ID=313372 | ||
restart: "no" | ||
entrypoint: [ "bash", "-c", "sleep 2 && corepack enable && exec ./docker/deploy-contracts.sh"] | ||
- STORAGE_DIR=/var/indexer | ||
- DATABASE_URL=postgres://postgres:postgres@indexer-db:5432/postgres | ||
- INDEXED_CHAINS=dev1,dev2 | ||
- DEV1_RPC_URL=http://local-chain-1:8545 | ||
- DEV2_RPC_URL=http://local-chain-2:8545 | ||
- IPFS_GATEWAY=http://pina:8000 | ||
- PASSPORT_SCORER_ID=335 | ||
- PASSPORT_API_KEY=xn9e7AFv.aEfS0ioNhaVtww1jdwnsWtxnrNHspVsS | ||
- COINGECKO_API_KEY=CG-9B9jhrcgAbCdN1QX9bVa1o7v | ||
- PORT=4000 | ||
- DEPLOYMENT_ENVIRONMENT=local | ||
- LOG_LEVEL=debug | ||
- ENABLE_RESOURCE_MONITOR=false | ||
- BUILD_TAG=local | ||
|
||
entrypoint: ["bash", "-c", "sleep 2 && node dist/src/index.js --http-wait-for-sync=false --drop-db | ./node_modules/.bin/pino-pretty"] | ||
|
||
networks: | ||
grants-stack: | ||
name: grants-stack | ||
driver: bridge | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,5 @@ yarn-error.log* | |
.eslintcache | ||
.vercel | ||
.env*.local | ||
|
||
/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as metamask from "@synthetixio/synpress/commands/metamask"; | ||
import { test } from "../fixtures"; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
// baseUrl is set in playwright.config.ts | ||
await page.goto("/"); | ||
}); | ||
|
||
test("main page loads and wallet connects", async ({ page }) => { | ||
await page.getByRole("navigation").getByTestId("rk-connect-button").click(); | ||
await page.getByText("Metamask").click(); | ||
await metamask.acceptAccess(); | ||
await page.getByText("My Projects").waitFor(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { type BrowserContext, chromium, test as base } from "@playwright/test"; | ||
import { initialSetup } from "@synthetixio/synpress/commands/metamask"; | ||
import { setExpectInstance } from "@synthetixio/synpress/commands/playwright"; | ||
import { resetState } from "@synthetixio/synpress/commands/synpress"; | ||
import { prepareMetamask } from "@synthetixio/synpress/helpers"; | ||
import { config } from "dotenv"; | ||
|
||
export const test = base.extend<{ | ||
context: BrowserContext; | ||
}>({ | ||
// eslint-disable-next-line no-empty-pattern | ||
context: async ({}, use) => { | ||
config({ | ||
path: ["./.env.local", "./.env", "./.env.test"], | ||
}); | ||
|
||
// required for synpress as it shares same expect instance as playwright | ||
// eslint-disable-next-line @typescript-eslint/no-use-before-define | ||
await setExpectInstance(expect); | ||
|
||
// download metamask | ||
const metamaskPath = await prepareMetamask( | ||
process.env.METAMASK_VERSION || "10.25.0" | ||
); | ||
|
||
// prepare browser args | ||
const browserArgs = [ | ||
`--disable-extensions-except=${metamaskPath}`, | ||
`--load-extension=${metamaskPath}`, | ||
"--remote-debugging-port=9222", | ||
]; | ||
|
||
if (process.env.CI) { | ||
browserArgs.push("--disable-gpu"); | ||
} | ||
|
||
if (process.env.HEADLESS_MODE) { | ||
browserArgs.push("--headless=new"); | ||
} | ||
|
||
// launch browser | ||
const context = await chromium.launchPersistentContext("", { | ||
headless: false, | ||
args: browserArgs, | ||
}); | ||
|
||
// wait for metamask | ||
await context.pages()[0].waitForTimeout(3000); | ||
|
||
// setup metamask | ||
await initialSetup(chromium, { | ||
secretWordsOrPrivateKey: | ||
process.env.TEST_PRIVATE_KEY ?? | ||
"test test test test test test test test test test test junk", | ||
network: "optimism", | ||
password: "Tester@1234", | ||
enableAdvancedSettings: true, | ||
}); | ||
|
||
await use(context); | ||
|
||
await context.close(); | ||
|
||
await resetState(); | ||
}, | ||
}); | ||
|
||
// eslint-disable-next-line prefer-destructuring | ||
export const expect = test.expect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { defineConfig, devices } from "@playwright/test"; | ||
|
||
export default defineConfig({ | ||
testDir: "./e2e", | ||
timeout: 60 * 1000, | ||
expect: { | ||
timeout: 5000, | ||
}, | ||
fullyParallel: true, | ||
forbidOnly: !!process.env.CI, | ||
retries: process.env.CI ? 1 : 0, | ||
workers: 1, | ||
reporter: "html", | ||
use: { | ||
actionTimeout: 0, | ||
baseURL: "http://localhost:3000", | ||
trace: "on-first-retry", | ||
headless: false, | ||
}, | ||
// start local web server before tests | ||
webServer: [ | ||
{ | ||
command: "pnpm start", | ||
url: "http://localhost:3000", | ||
timeout: 5000, | ||
reuseExistingServer: true, | ||
}, | ||
], | ||
projects: [ | ||
{ | ||
name: "chromium", | ||
use: { ...devices["Desktop Chrome"] }, | ||
}, | ||
], | ||
outputDir: "test-results", | ||
}); |
Oops, something went wrong.