Skip to content

Commit

Permalink
feature: update starship context to include timeout, update tests (#562)
Browse files Browse the repository at this point in the history
* update starship context to include timeout, update tests

* add timeout to params

* fix lint
  • Loading branch information
Anmol1696 authored Oct 3, 2024
1 parent 02a26e0 commit 5d6ef8a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions clients/js/__output__/custom-pod-ports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ chains:
defaultPorts:
rpc: 26657
grpc: 9090
grpc-web: 9091
rest: 1317
exposer: 8081
faucet: 8000
Expand Down
5 changes: 4 additions & 1 deletion clients/js/packages/cli/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export const params: string[] = [
'repo',
'repoUrl',
'chart',
'namespace'
'namespace',
'timeout',
];

export const loadConfig = (argv: any): Config => {
Expand Down Expand Up @@ -89,6 +90,8 @@ Command-line Options:
Will overide config file settings for name.
--version <ver> Specify the version of the Helm chart, default: v0.2.6.
Will overide config file settings for version.
--timeout <time> Specify the timeout for the Helm operations, default: 10m.
Will overide config file settings for timeout.
Examples:
$ starship start --config ./config/two-chain.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ helm repo update
helm search repo starship/devnet --version v0.2.3
Call: deploy()
Log: Installing the helm chart. This is going to take a while.....
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
Log: Run "starship get-pods" to check the status of the cluster
Call: startPortForward()
Log: Attempting to stop any existing port-forwards...
Expand Down Expand Up @@ -46,7 +46,7 @@ exports[`StarshipClient setup 2`] = `
"helm repo add starship https://cosmology-tech.github.io/starship/
helm repo update
helm search repo starship/devnet --version v0.2.3
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
ps -ef | grep -i 'kubectl port-forward' | grep -v 'grep' | awk '{print $2}'
sleep 2
kubectl port-forward pods/osmosis-1-genesis-0 26657:26657 > /dev/null 2>&1 &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ helm repo update
helm search repo starship/devnet --version v0.2.3
Call: deploy()
Log: Installing the helm chart. This is going to take a while.....
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
Log: Run "starship get-pods" to check the status of the cluster
Call: startPortForward()
Log: Attempting to stop any existing port-forwards...
Expand Down Expand Up @@ -44,7 +44,7 @@ exports[`StarshipClient setup 2`] = `
"helm repo add starship https://cosmology-tech.github.io/starship/
helm repo update
helm search repo starship/devnet --version v0.2.3
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
ps -ef | grep -i 'kubectl port-forward' | grep -v 'grep' | awk '{print $2}'
sleep 2
kubectl port-forward pods/osmosis-1-genesis-0 1317:6767676 > /dev/null 2>&1 &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ helm repo update
helm search repo starship/devnet --version v0.2.3
Call: deploy()
Log: Installing the helm chart. This is going to take a while.....
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
Log: Run "starship get-pods" to check the status of the cluster
Call: startPortForward()
Log: Attempting to stop any existing port-forwards...
Expand Down Expand Up @@ -44,7 +44,7 @@ exports[`StarshipClient setup 2`] = `
"helm repo add starship https://cosmology-tech.github.io/starship/
helm repo update
helm search repo starship/devnet --version v0.2.3
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
ps -ef | grep -i 'kubectl port-forward' | grep -v 'grep' | awk '{print $2}'
sleep 2
kubectl port-forward pods/osmosis-1-genesis-0 26657:26657 > /dev/null 2>&1 &
Expand Down
8 changes: 6 additions & 2 deletions clients/js/packages/client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface StarshipContext {
namespace?: string;
verbose?: boolean;
curdir?: string;
timeout?: string;
}

export const defaultStarshipContext: Partial<StarshipContext> = {
Expand All @@ -30,7 +31,8 @@ export const defaultStarshipContext: Partial<StarshipContext> = {
repoUrl: 'https://cosmology-tech.github.io/starship/',
chart: 'starship/devnet',
namespace: '',
version: ''
version: '',
timeout: '10m'
};

export interface PodPorts {
Expand All @@ -47,7 +49,7 @@ export interface PodPorts {
}

const defaultName: string = 'starship';
const defaultVersion: string = 'v0.2.13';
const defaultVersion: string = 'v0.2.14';

// TODO talk to Anmol about moving these into yaml, if not already possible?
const defaultPorts: PodPorts = {
Expand Down Expand Up @@ -395,6 +397,8 @@ export class StarshipClient implements StarshipClientI {
this.ctx.chart,
'--version',
this.config.version,
'--timeout',
this.ctx.timeout,
...this.getDeployArgs(),
...options
];
Expand Down

0 comments on commit 5d6ef8a

Please sign in to comment.