-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multichain-testing:
make start
single command start (#10002)
closes: #9855 ## Description Adds a `pod-readiness.ts` script and documents a single command (`make start`) setup for starship multichain-testing. Reviewers, please pull this down and try something like `make start && yarn test test/basic-flows.test.ts` to verify it's working. ### Security Considerations n/a ### Scaling Considerations n/a ### Documentation Considerations Includes updated documentation. ### Testing Considerations Manually tested by author and reviewers. In CI, the starship gh action does this check for us so this script is not needed there. ### Upgrade Considerations n/a
- Loading branch information
Showing
3 changed files
with
77 additions
and
19 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
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 { execa } from 'execa'; | ||
import { sleep } from '../tools/sleep.ts'; | ||
|
||
const checkPodsReadiness = async (): Promise<boolean> => { | ||
const { stdout } = await execa('kubectl', ['get', 'pods']); | ||
console.clear(); | ||
console.log('Current pod status:'); | ||
console.log(stdout); | ||
|
||
const lines = stdout.split('\n').slice(1); // Skip the header line | ||
return ( | ||
lines.length > 0 && | ||
lines.every(line => { | ||
const [, ready] = line.split(/\s+/); | ||
const [readyCount, totalCount] = ready.split('/'); | ||
return readyCount === totalCount; | ||
}) | ||
); | ||
}; | ||
|
||
const main = async () => { | ||
console.log('Starting pod readiness check...'); | ||
for (;;) { | ||
const allReady = await checkPodsReadiness(); | ||
if (allReady) { | ||
console.log('All pods are ready!'); | ||
process.exit(0); | ||
} | ||
await sleep(2 * 1_000); | ||
} | ||
}; | ||
|
||
main().catch(error => { | ||
console.error('An error occurred:', error); | ||
process.exit(1); | ||
}); |