Skip to content

Commit

Permalink
Remove bash e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sutaakar authored and openshift-ci[bot] committed Oct 11, 2023
1 parent cbdbed2 commit 576c53e
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 922 deletions.
111 changes: 8 additions & 103 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,23 @@
# Running Tests Manually

Manually running tests requires use of the the [opendatahub-io/peak](https://github.com/opendatahub-io/peak) project.

## Prerequisites

* Admin access to an OpenShift cluster ([CRC](https://developers.redhat.com/products/openshift-local/overview) is fine)

* Mac users may need to do the following:

```bash
brew install coreutils
ln -s /usr/local/bin/greadlink /usr/local/bin/readlink
```

* NOTE: The tests appear to be flaky when running from mac. Running from linux is actually the recommended way to run them.

* If you run these tests in a local cluster and have not deployed the Open Data Hub on your OpenShift cluster:

```bash
# Install CodeFlare operator
oc apply -f https://raw.githubusercontent.com/opendatahub-io/distributed-workloads/main/tests/resources/codeflare-subscription.yaml

installPlanName=$(oc get installplans -n openshift-operators -o jsonpath='{.items[?(@.metadata.ownerReferences[0].name=="codeflare-operator")].metadata.name}')
oc patch installplan $installPlanName -n openshift-operators --type merge -p '{"spec":{"approved":true}}'

# Install ODH operator and wait for the deploy/opendatahub-operator-controller-manager in the openshift-operators namespace to become available
oc apply -f https://raw.githubusercontent.com/opendatahub-io/distributed-workloads/main/tests/resources/odh-subscription.yaml

# Deploy Open Data Hub core components
oc new-project opendatahub
oc apply -f https://raw.githubusercontent.com/opendatahub-io/odh-manifests/master/kfdef/odh-core.yaml -n opendatahub

# Deploy CodeFlare stack
oc apply -f https://raw.githubusercontent.com/opendatahub-io/distributed-workloads/main/codeflare-stack-kfdef.yaml
```

## Bash tests - Setup

Clone the [opendatahub-io/peak](https://github.com/opendatahub-io/peak) project anywhere you like in your working environment. But, do not clone it into the `distributed-workloads` directory.

```bash
git clone https://github.com/opendatahub-io/peak
cd peak
```

Then we need to update the peak project with its submodule dependencies. Specifically, [opendatahub-io/openshift-test-kit](https://github.com/opendatahub-io/openshift-test-kit/tree/0e469c4bf967b531780eb05d6b96463214288db7) defined in the `.gitmodules` file.

```bash
git submodule update --init
```

Now we need to pull our `distributed workloads` project into the peak repo for testing. This is done by creating a file, `my-list`, that contains the repository name you want to use, the channel, the repo's location (this can be a github url or a relative path to a local directory) and branch name.

For example, if you cloned peak into the same directory level as `distributed-workloads`, then you would create a file, `my-list`, in the following way:

```bash
echo distributed-workloads nil ../distributed-workloads main > my-list
```

Now we can setup our tests.

```bash
./setup.sh -t my-list
```

This should create a directory, `distributed-workloads` in the `operator-tests` directory of the peak repo.

## Bash tests - Running Tests

`run.sh` will search through the 'operator-tests' directory for a *.sh file name we provide to it as an argument. In this case, we want to run the `distributed-workloads.sh` script.

```bash
./run.sh distributed-workloads.sh
```

If everything is working correctly you should see an output similar to the below:

```bash
Running example test

Running operator-tests/distributed-workloads/tests/basictests/distributed-workloads.sh:15: executing 'oc project opendatahub' expecting success...


✔ SUCCESS after 0.184s: operator-tests/distributed-workloads/tests/basictests/distributed-workloads.sh:15: executing 'oc project opendatahub' expecting success

Running operator-tests/distributed-workloads/tests/basictests/distributed-workloads.sh:16: executing 'oc get pods' expecting success...


✔ SUCCESS after 0.127s: operator-tests/distributed-workloads/tests/basictests/distributed-workloads.sh:16: executing 'oc get pods' expecting success
# Go to the root folder of the repository
cd ..

# Install CodeFlare operator
make install-codeflare-operator

Installing Codeflare Operator


Installing distributed workloads kfdef


Testing MCAD TorchX Functionality


Testing MCAD Ray Functionality


Uninstalling distributed workloads kfdef


Uninstalling Codeflare Operator

```

In some cases, your cluster may not have the default user+password(admin, admin) combination on it. In those situations, you can manually pass in a custom user and password by running tests as below:
# Install ODH operator
make install-opendatahub-operator

```bash
OPENSHIFT_TESTUSER_NAME=<user_name> OPENSHIFT_TESTUSER_PASS=<password> ./run.sh distributed-workloads.sh
# Deploy ODH and CodeFlare stack
make deploy-codeflare
```

## Go tests - Setup
Expand Down
165 changes: 0 additions & 165 deletions tests/basictests/distributed-workloads.sh

This file was deleted.

56 changes: 0 additions & 56 deletions tests/basictests/ray.sh

This file was deleted.

12 changes: 0 additions & 12 deletions tests/resources/codeflare-subscription.yaml

This file was deleted.

Loading

0 comments on commit 576c53e

Please sign in to comment.