#!/usr/bin/env bash

cd /tmp
cat <<EOF > /var/www/coyote-tests/results
{
  "passed": 0,
  "failed": 0
}
EOF

coyote -c /usr/share/landoop/kafka-tests.yml -out /var/www/coyote-tests/index.html

EXITCODE=$?

PASSED="$(grep -A1 '"label": "passed"' /var/www/coyote-tests/index.html | grep value | sed -re 's/.*"value": ([0-9]*),/\1/')"
FAILED="$(grep -A1 '"label": "failed"' /var/www/coyote-tests/index.html | grep value | sed -re 's/.*"value": ([0-9]*),/\1/')"

cat <<EOF > /var/www/coyote-tests/results
{
  "passed": ${PASSED},
  "failed": ${FAILED}
}
EOF

exit $EXITCODE

#!/usr/bin/env bash
RUNTESTS="${RUNTESTS:-1}"

if [[ "$RUNTESTS" == "0" ]]; then
    echo "Skipping tests due to \$RUNTESTS = 0."
    cat <<EOF > /var/www/coyote-tests/results
{
  "passed": -1,
  "failed": 0
}
EOF
    exit 0
fi

cd /tmp
cat <<EOF > /var/www/coyote-tests/results
{
  "passed": 0,
  "failed": 0
}
EOF

coyote -c /usr/share/landoop/kafka-tests.yml -out /var/www/coyote-tests/index.html

EXITCODE=$?

PASSED="$(grep -A1 '"label": "passed"' /var/www/coyote-tests/index.html | grep value | sed -re 's/.*"value": ([0-9]*),/\1/')"
FAILED="$(grep -A1 '"label": "failed"' /var/www/coyote-tests/index.html | grep value | sed -re 's/.*"value": ([0-9]*),/\1/')"

cat <<EOF > /var/www/coyote-tests/results
{
  "passed": ${PASSED},
  "failed": ${FAILED}
}
EOF

exit $EXITCODE

Add undocumentend environment variable RUNTESTS which, when set to 0, makes fast-data-dev to skip tests. Intended for internal use for now.
Add undocumentend environment variable RUNTESTS which, when set to 0, makes fast-data-dev to skip tests. Intended for internal use for now.

Signed-off-by: Marios Andreopoulos <279a4cf6d7f8da1ddc113bb946b9273d9d938683@andmarios.com>
