Skip to content

Commit

Permalink
add setup script for e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
  • Loading branch information
leninmehedy committed Jan 23, 2024
1 parent 505ab8d commit 644c0e0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/zxc-fsnetman-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,7 @@ jobs:
run: |
npm i
npm link
kind create cluster -n fst
kubectl create ns fst-e2e
fsnetman init -d ../charts --namespace fst-e2e
fsnetman cluster setup --cert-manager --cert-manager-crds
fsnetman chart install --enable-tls --self-signed --enable-hedera-explorer-tls --acme-cluster-issuer
./test/e2e/setup-e2e.sh
npm run test-e2e
- name: Output logs
Expand Down
38 changes: 27 additions & 11 deletions fullstack-network-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,41 @@ Full Stack Network Manager (fsnetman) is a CLI tool to manage and deploy a Heder

* Run `npm install -g @hashgraph/fullstack-network-manager`

* Run `fsnetman` from a terminal as shown below
* Ensure you have a valid kubernetes context, cluster and namespace. You may use `kind` and `kubectl` CLIs to create
cluster and namespace as below (See [`test/e2e/setup-e2e.sh`](test/e2e/setup_e2e.sh)):

```
export FST_CLUSTER_NAME=fst-local
export FST_NAMESPACE=fst-local
kind create cluster -n "${FST_CLUSTER_NAME}"
kubectl create ns "${FST_NAMESPACE}"
fsnetman init -d ../charts --namespace "${FST_NAMESPACE}" # cache args for subsequent commands
```

* Run `fsnetman` from a terminal, It may show usage options as shown below:

```
❯ fsnetman
-------------------------------------------------------------------------------
*** Fullstack Network Manager (FsNetMan) ***
Version : 0.16.0
Kubernetes Context : kind-fst-local
Kubernetes Cluster : kind-fst-local
-------------------------------------------------------------------------------
Usage:
fsnetman <command> [options]
Commands:
fsnetman init Perform dependency checks and initialize local environment
fsnetman cluster Manage FST cluster
fsnetman chart Manage FST chart deployment
fsnetman cluster Manage cluster
fsnetman chart Manage chart deployment
fsnetman node Manage a node running Hedera platform
fsnetman relay Manage JSON RPC relays
Options:
--dev Enable developer mode [boolean] [default: false]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Expand Down Expand Up @@ -57,11 +79,5 @@ Select a command
## E2E tests

* In order to run E2E test, we need to set up cluster and install the chart.

```
fsnetman init -d ../charts # use the charts directory for all subsequent commands
fsnetman cluster create
fsnetman cluster setup --cert-manager --cert-manager-crds
fsnetman chart install --enable-tls --self-signed --enable-hedera-explorer-tls
npm run test-e2e
```
* Run `./test/e2e/setup-e2e.sh`
* Run `npm run test-e2e`
9 changes: 9 additions & 0 deletions fullstack-network-manager/test/e2e/setup_e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
FST_CLUSTER_NAME=fst-local
FST_NAMESPACE=fst-local
kind delete cluster -n "${FST_CLUSTER_NAME}" || true
kind create cluster -n "${FST_CLUSTER_NAME}" || exit 1
kubectl create ns "${FST_NAMESPACE}" || exit 1
fsnetman init -d ../charts --namespace "${FST_NAMESPACE}" || exit 1 # cache args for subsequent commands
fsnetman cluster setup --cert-manager --cert-manager-crds || exit 1
fsnetman chart install --enable-tls --self-signed --enable-hedera-explorer-tls --acme-cluster-issuer || exit 1

0 comments on commit 644c0e0

Please sign in to comment.