Skip to content

Commit

Permalink
Fix for cd_dev (#1612)
Browse files Browse the repository at this point in the history
Fix cli cross compat test in CD_Dev Broken by #1607
  • Loading branch information
tjtelan committed Sep 11, 2021
1 parent 5da3f7c commit 97df132
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/cd_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,11 @@ jobs:
cli_version: [stable, latest]
steps:
- uses: actions/checkout@v2
- uses: nolar/setup-k3d-k3s@v1
- name: Setup K3d
run: curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
- name: Create K3d cluster
run: |
./k8-util/cluster/reset-k3d.sh
- name: CLI ${{ matrix.cli_version }} x Cluster ${{ matrix.cluster_version }}
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 1
command: |
make CLI_VERSION=${{ matrix.cli_version }} CLUSTER_VERSION=${{ matrix.cluster_version }} cli-platform-cross-version-test
run: |
make FLUVIO_BIN=~/.fluvio/bin/fluvio CLI_VERSION=${{ matrix.cli_version }} CLUSTER_VERSION=${{ matrix.cluster_version }} cli-platform-cross-version-test
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,6 @@ jobs:
run: |
curl -fsS https://packages.fluvio.io/v1/install.sh | bash
~/.fluvio/bin/fluvio cluster start
- name: Download artifact - fluvio
uses: actions/download-artifact@v2
with:
Expand Down
20 changes: 8 additions & 12 deletions tests/cli-platform-cross-version-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ set -e
readonly CLI_VERSION=${1-stable}
readonly CLUSTER_VERSION=${2-latest}
readonly TEST_TOPIC=$CLI_VERSION-x-$CLUSTER_VERSION
readonly FLUVIO_BIN=${FLUVIO_BIN:-~/.fluvio/bin/fluvio}
readonly PAYLOAD_SIZE=${PAYLOAD_SIZE:-100}
readonly CI_SLEEP=${CI_SLEEP:-5}
readonly CI=${CI:-}
readonly SKIP_SETUP=${SKIP_SETUP:-}
readonly SKIP_CLEANUP=${SKIP_CLEANUP:-}

# If we're in CI, we want to slow down execution
# to give CPU some time to rest, so we don't time out
function ci_check() {
:
}
if [[ -z "$SKIP_SETUP" ]];
then
# This will default to the Makefile value if not provided
readonly FLUVIO_BIN=${FLUVIO_BIN?Set FLUVIO_BIN if skipping setup}
else
# We want to avoid letting Makefile set bin path to target dir
readonly FLUVIO_BIN=~/.fluvio/bin/fluvio
fi

function setup_cluster() {
echo "Installing cluster @ VERSION: $CLUSTER_VERSION"
Expand All @@ -38,16 +40,12 @@ function setup_cli() {

function run_test() {
local TEST_DATA=$(shuf -zer -n${PAYLOAD_SIZE} {A..Z} {a..z} {0..9} | tr -d '\0')
ci_check;

$FLUVIO_BIN topic create $TEST_TOPIC || true
ci_check;

echo $TEST_DATA | $FLUVIO_BIN produce $TEST_TOPIC
ci_check;

$FLUVIO_BIN consume $TEST_TOPIC -B -d
ci_check;
# TODO: Verify the test output matches
}

Expand All @@ -69,9 +67,7 @@ function main() {
if [[ -z "$SKIP_SETUP" ]];
then
setup_cluster $CLUSTER_VERSION;
ci_check;
setup_cli $CLI_VERSION;
ci_check;
else
echo "Skipping setup"
fi
Expand Down

0 comments on commit 97df132

Please sign in to comment.