diff --git a/.github/actions/e2e-test/action.yaml b/.github/actions/e2e-test/action.yaml index d39e9448..6d153be3 100644 --- a/.github/actions/e2e-test/action.yaml +++ b/.github/actions/e2e-test/action.yaml @@ -63,15 +63,42 @@ runs: go-version: "1.21" check-latest: true + - name: Create yarn.lock and package.json file if not exists + run: | + if [ ! -f $GITHUB_WORKSPACE/yarn.lock ]; then + echo 'Creating temporary yarn.lock file' + echo '' > $GITHUB_WORKSPACE/yarn.lock + fi + if [ ! -f $GITHUB_WORKSPACE/package.json ]; then + echo 'Creating temporary package.json file' + echo '{}' > $GITHUB_WORKSPACE/package.json + fi + shell: bash + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.x" + cache: "yarn" + + - name: Install starship CLI + run: | + cd clients/js + yarn + yarn build + chmod +x node_modules/.bin/starship + echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV + shell: bash + - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@0.3.0 + uses: cosmology-tech/starship-action@0.5.1 with: - values: ${{ env.CONFIG_FILE }} - port-forward: true + config: ${{ env.CONFIG_FILE }} version: 0.0.0 chart: ./starship/charts/devnet kubeconfig: ${{ steps.kubeconfig.outputs.content }} + cli-version: 0.0.0 - name: Run tests run: | diff --git a/.github/workflows/pr-tests.yaml b/.github/workflows/pr-tests.yaml index a05e7ba0..c47e6ee0 100644 --- a/.github/workflows/pr-tests.yaml +++ b/.github/workflows/pr-tests.yaml @@ -21,10 +21,6 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 - defaults: - run: - working-directory: starship - strategy: matrix: config-file: @@ -52,20 +48,46 @@ jobs: go-version: "1.21" check-latest: true + - name: Create yarn.lock and package.json file if not exists + run: | + if [ ! -f $GITHUB_WORKSPACE/yarn.lock ]; then + echo 'Creating temporary yarn.lock file' + echo '' > $GITHUB_WORKSPACE/yarn.lock + fi + if [ ! -f $GITHUB_WORKSPACE/package.json ]; then + echo 'Creating temporary package.json file' + echo '{}' > $GITHUB_WORKSPACE/package.json + fi + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.x" + cache: "yarn" + + - name: Install starship CLI + run: | + cd clients/js + yarn + yarn build + chmod +x node_modules/.bin/starship + echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV + - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@0.3.0 + uses: cosmology-tech/starship-action@0.5.1 with: - values: ${{ env.CONFIG_FILE }} - port-forward: true + config: ${{ env.CONFIG_FILE }} version: 0.0.0 chart: ./starship/charts/devnet + cli-version: 0.0.0 - name: Run tests run: | cd tests/e2e/ && go test -v ./... env: TEST_CONFIG_FILE: ${{ env.CONFIG_FILE }} + working-directory: starship # todo: change this to be post step of the action - name: Cleanup cluster @@ -76,3 +98,4 @@ jobs: env: DEVNET_NAME: ${{ steps.starship-action.outputs.name }} DEVNET_NAMESPACE: ${{ steps.starship-action.outputs.namespace }} + working-directory: starship diff --git a/.github/workflows/smoke-tests.yaml b/.github/workflows/smoke-tests.yaml index 59a90f9f..2651add7 100644 --- a/.github/workflows/smoke-tests.yaml +++ b/.github/workflows/smoke-tests.yaml @@ -27,15 +27,39 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Create yarn.lock and package.json file if not exists + run: | + if [ ! -f $GITHUB_WORKSPACE/yarn.lock ]; then + echo 'Creating temporary yarn.lock file' + echo '' > $GITHUB_WORKSPACE/yarn.lock + fi + if [ ! -f $GITHUB_WORKSPACE/package.json ]; then + echo 'Creating temporary package.json file' + echo '{}' > $GITHUB_WORKSPACE/package.json + fi + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.x" + cache: "yarn" + + - name: Install starship CLI + run: | + cd clients/js + yarn + yarn build + chmod +x node_modules/.bin/starship + echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV + - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@0.3.0 + uses: cosmology-tech/starship-action@0.5.1 with: - values: ${{ env.CONFIG_FILE }} - port-forward: true + config: ${{ env.CONFIG_FILE }} version: 0.0.0 chart: ./starship/charts/devnet - timeout: 10m + cli-version: 0.0.0 # todo: change this to be post step of the action - name: Cleanup cluster @@ -64,15 +88,39 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Create yarn.lock and package.json file if not exists + run: | + if [ ! -f $GITHUB_WORKSPACE/yarn.lock ]; then + echo 'Creating temporary yarn.lock file' + echo '' > $GITHUB_WORKSPACE/yarn.lock + fi + if [ ! -f $GITHUB_WORKSPACE/package.json ]; then + echo 'Creating temporary package.json file' + echo '{}' > $GITHUB_WORKSPACE/package.json + fi + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.x" + cache: "yarn" + + - name: Install starship CLI + run: | + cd clients/js + yarn + yarn build + chmod +x node_modules/.bin/starship + echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV + - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@0.3.0 + uses: cosmology-tech/starship-action@0.5.1 with: - values: ${{ env.CONFIG_FILE }} - port-forward: true + config: ${{ env.CONFIG_FILE }} version: 0.0.0 chart: ./starship/charts/devnet - timeout: 10m + cli-version: 0.0.0 # todo: change this to be post step of the action - name: Cleanup cluster @@ -101,15 +149,39 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Create yarn.lock and package.json file if not exists + run: | + if [ ! -f $GITHUB_WORKSPACE/yarn.lock ]; then + echo 'Creating temporary yarn.lock file' + echo '' > $GITHUB_WORKSPACE/yarn.lock + fi + if [ ! -f $GITHUB_WORKSPACE/package.json ]; then + echo 'Creating temporary package.json file' + echo '{}' > $GITHUB_WORKSPACE/package.json + fi + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.x" + cache: "yarn" + + - name: Install starship CLI + run: | + cd clients/js + yarn + yarn build + chmod +x node_modules/.bin/starship + echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV + - name: Setup Test infra id: starship-action - uses: cosmology-tech/starship-action@0.3.0 + uses: cosmology-tech/starship-action@0.5.1 with: - values: ${{ env.CONFIG_FILE }} - port-forward: true + config: ${{ env.CONFIG_FILE }} version: 0.0.0 chart: ./starship/charts/devnet - timeout: 10m + cli-version: 0.0.0 # todo: change this to be post step of the action - name: Cleanup cluster diff --git a/clients/js/packages/client/src/client.ts b/clients/js/packages/client/src/client.ts index e569a7e2..f72d511f 100644 --- a/clients/js/packages/client/src/client.ts +++ b/clients/js/packages/client/src/client.ts @@ -29,7 +29,7 @@ export const defaultStarshipContext: Partial = { helmRepo: 'starship', helmRepoUrl: 'https://cosmology-tech.github.io/starship/', helmChart: 'starship/devnet', - helmVersion: 'v0.2.3', + helmVersion: 'v0.2.4', helmNamespace: '', }; diff --git a/starship/charts/devnet/templates/chains/cosmos/cometmock.yaml b/starship/charts/devnet/templates/chains/cosmos/cometmock.yaml index 68bae1e7..80b4a38d 100644 --- a/starship/charts/devnet/templates/chains/cosmos/cometmock.yaml +++ b/starship/charts/devnet/templates/chains/cosmos/cometmock.yaml @@ -128,22 +128,24 @@ spec: - bash - "-c" - | - mkdir -p /chain/genesis/config /chain/genesis/data + mkdir -p /chain/genesis/config + mkdir -p /chain/genesis/data curl http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/genesis -o /chain/genesis/config/genesis.json echo "Genesis file that we got....." cat /chain/genesis/config/genesis.json ## fetch priv_validator and priv_validator_state of all validators curl http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys -o /chain/genesis/config/priv_validator_key.json - curl http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_validator_state -o /chain/genesis/data/priv_validator_state.json + echo '{"height":"0","round":0,"step":0}' > /chain/genesis/data/priv_validator_state.json {{- if gt $chain.numValidators 1.0}} for i in $(seq 0 {{ sub $chain.numValidators 2 }}); do - mkdir -p /chain/validator-$i/config /chain/validator-$i/data + mkdir -p /chain/validator-$i/config + mkdir -p /chain/validator-$i/data curl http://{{ $chain.hostname }}-validator-$i.{{ $chain.hostname }}-validator.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/node_key -o /chain/validator-$i/config/node_key.json curl http://{{ $chain.hostname }}-validator-$i.{{ $chain.hostname }}-validator.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys -o /chain/validator-$i/config/priv_validator_key.json - curl http://{{ $chain.hostname }}-validator-$i.{{ $chain.hostname }}-validator.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_validator_state -o /chain/validator-$i/data/priv_validator_state.json + echo '{"height":"0","round":0,"step":0}' > /chain/validator-$i/data/priv_validator_state.json done {{- end }} diff --git a/starship/tests/e2e/configs/multi-validator.yaml b/starship/tests/e2e/configs/multi-validator.yaml index 5d25a1a5..462385e5 100644 --- a/starship/tests/e2e/configs/multi-validator.yaml +++ b/starship/tests/e2e/configs/multi-validator.yaml @@ -8,12 +8,8 @@ chains: exposer: 38083 faucet: 8000 resources: - limits: - cpu: "0.4" - memory: 1Gi - requests: - cpu: "0.2" - memory: 600M + cpu: "0.3" + memory: 600M faucet: concurrency: 2 resources: