Skip to content

Commit

Permalink
Merge pull request konveyor#26 from aufi/add-hub-api-tests
Browse files Browse the repository at this point in the history
Add Hub core API tests execution
  • Loading branch information
aufi committed Oct 12, 2023
2 parents 66b4dab + e58fcf6 commit 6bce499
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
VENDOR_DIR ?= /tmp/konveyor-vendor
ARCH ?= amd64
BRANCH ?= main


# Setup local minikube with tackle - work in progress (TODO: enable auth)
# This is for local setup, CI uses shared github actions
Expand Down Expand Up @@ -32,6 +34,7 @@ test-tier0:

# TIER1 - all normal features expected to work.
test-tier1:
${MAKE} test-hub-api
$(MAKE) test-metrics
TIER1=1 $(MAKE) test-analysis

Expand Down Expand Up @@ -59,7 +62,11 @@ test-jira:
ginkgo -v -focus "Jira cloud"


# Add next features tests here and call the target from appropriate tier.
# Hub API remote tests.
test-hub-api:
./hub-api/run-tests.sh ${BRANCH}

# Add next features tests here and call the target from appropriate stage.

# Execute all tests.
test-all: test-tier0 test-tier1 test-tier2
7 changes: 7 additions & 0 deletions hub-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Hub API remote tests

Script ```run-tests.sh``` downloads Hub and executes its tests on running Konveyor.

Usage: ```./run-tests.sh <branch-name>``` (default to main).

Environment variables for HUB_BASE_URL and login/password are expected in the same way as common in this repository.
25 changes: 25 additions & 0 deletions hub-api/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
#
# Script for downloading Hub and executing its tests on running Konveyor.
#
# Usage: ./run-tests.sh <branch-name>
#
# ENV variables for HUB_BASE_URL and login/password are expected.
#

export BRANCH=$1
export HUB_TMP_DIR="/tmp/tackle2-hub-test"

if [ -z $BRANCH ]; then
echo "Assuming 'main' branch to be used for Hub."
export BRANCH="main"
fi

if [ -d $HUB_TMP_DIR ]; then
cd $HUB_TMP_DIR
git pull origin ${BRANCH}
else
git clone --branch ${BRANCH} https://github.com/konveyor/tackle2-hub.git $HUB_TMP_DIR && cd $_
fi

make test-api

0 comments on commit 6bce499

Please sign in to comment.