-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use consistent CI tooling. Include recent local
single-repo feature.
#1
Conversation
c015684
to
ab188fb
Compare
@carsonfarmer There's a ton of changes here, as such it's potentially better to just look at the state of the branch then look at the diff. |
UPDATE: |
local
single-repo feature.
export const TEST_TIMEOUT_FACTOR = getTimeoutFactor(); | ||
export const TEST_PROVIDER_URL = `http://127.0.0.1:${registryPort}`; | ||
export const TEST_VALIDATOR_URL = "http://localhost:8082/api/v1"; |
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.
Using custom ports for each package so tests can run in parallel
|
||
const accounts = getAccounts(); | ||
const db = getDatabase(accounts[1]); |
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.
Because of the use of custom ports we can't use the default database connection anymore.
TEST_PROVIDER_URL, | ||
"--chain", | ||
"local-tableland", | ||
]; |
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 --chain
flag was getting repeated for most of the tests, plus we need a way to specify the provider url that includes the custom port.
{ | ||
"Impl": "mesa", | ||
"HTTP": { | ||
"Port": "8082", |
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.
Each package's tests have their own validator config, which enables Lerna to run in parallel.
|
||
equal(resolverMock.calledOnce, true); | ||
}); | ||
|
||
test("passes with GRANT statement", async function () { |
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.
These tests are an update that came from change to the singular repo in the last few weeks.
@@ -175,67 +220,97 @@ class LocalTableland { | |||
console.log("\n\n*************************************\n"); | |||
} | |||
|
|||
async #_setReady() { | |||
async #_setReady(): Promise<void> { |
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 local
tests were not written in typescript. As such there are a lot of changes that get typescript linting passing.
description: "Path the the Tableland Registry contract repository.", | ||
}, | ||
docker: { | ||
type: "boolean", |
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.
added in tablelandnetwork/local-tableland#423
"prepublishOnly": "npm run build", | ||
"test": "mocha", | ||
"test:browser": "PW_TS_ESM_ON=true playwright test", | ||
"test": "npm run test:browser && mocha --exit", |
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.
I'm not entirely sure why, but the github test workflow hangs forever if playwright tests are included. It may have to do with the custom ports for test networks, or some issue downloading the playwright test browsers. Either way, I wanted to get the transition to a monorepo done before looking into it anymore, so I've removed the requirement for browser tests from CI.
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.
Ok, yeh good idea. We can sort that out later.
// re-normalize so we can be sure we've isolated each statement and its tableId | ||
const norm = await normalize(stmt); | ||
|
||
if (norm.tables.length > 1) { |
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.
This is from tablelandnetwork/js-tableland#562
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.
I know this is from a previous PR, but we might want to explore handling more of this in the parser?
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.
Good call!
|
||
export function jsonFileAliases(filepath: string): AliasesNameMap { | ||
return { | ||
read: async function (): Promise<NameMapping> { |
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.
@asutula I tagged you as a reviewer here. @carsonfarmer probably has the most context to do a review, but if this kind of setup works well I'd suggest that we setup studio in a similar way. Specifically, the app could be a package and the cli could be a package. |
@carsonfarmer This PR is kind of a lot of changes, is there anything I can do to make it easier to review? |
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.
Ok, wow. This was a lot of work @joewagner! Really great stuff. Let's get this merged in, and we'll move forward from a unified point.
Really great work here, just a few tiny nits. We'll likely fine a few issues once we get this merged as well... so we can create separate issues for this as they crop up.
.github/CODEOWNERS
Outdated
@@ -2,4 +2,7 @@ | |||
# the repo. Unless a later match takes precedence. | |||
# By convention in @tablelandnetwork repos, the first listed | |||
# CODEOWNER is the repo DRI (directly responsible individual) | |||
* @joewagner @carsonfarmer @awmuncy | |||
* @carsonfarmer @joewagner | |||
* /packages/sdk/ @carsonfarmer @joewagner |
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.
Remove the *s on these lines
packages/local/src/main.ts
Outdated
// process was already killed—it *is* possible with the validator process | ||
// but doesn't seem to happen with the Registry | ||
try { | ||
// @ts-expect-error pic is possibly undefined, which is fine |
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.
should say pid
"prepublishOnly": "npm run build", | ||
"test": "mocha", | ||
"test:browser": "PW_TS_ESM_ON=true playwright test", | ||
"test": "npm run test:browser && mocha --exit", |
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.
Ok, yeh good idea. We can sort that out later.
// re-normalize so we can be sure we've isolated each statement and its tableId | ||
const norm = await normalize(stmt); | ||
|
||
if (norm.tables.length > 1) { |
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.
I know this is from a previous PR, but we might want to explore handling more of this in the parser?
97d5cc6
to
1cac967
Compare
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.
👍
Overview
This PR brings this repo up to date with the recent singular package repo feature additions, and also includes changes to linting and testing.
Details
The linting and testing changes are significant because each of the packages had slight variations on how that tooling was setup. The majority of the changes were bringing
local
andcli
up to date withsdk