scripts: move tests to separate folders

Doing some cleanup in "scripts" folder. All integration like tests are
moved under "test" directory (integration, bc, redis) and bash scripts
are adjusted to reflect new location.

As an addition "scripts/install-awscli.sh" was deleted as it was not
used.

Change-Id: I152905c4258f471a71f2d0e8731d91bb075e99c1
This commit is contained in:
Michal Niewrzal 2022-09-16 11:12:06 +02:00
parent 71bf43bcc6
commit a3d9630336
17 changed files with 18 additions and 28 deletions

View File

@ -218,12 +218,12 @@ test: test/setup ## Run tests against CockroachDB and Postgres (developer)
.PHONY: test-sim
test-sim: ## Test source with storj-sim (jenkins)
@echo "Running ${@}"
@./scripts/test-sim.sh
@./scripts/tests/integration/test-sim.sh
.PHONY: test-sim-redis-unavailability
test-sim-redis-unavailability: ## Test source with Redis availability with storj-sim (jenkins)
@echo "Running ${@}"
@./scripts/test-sim-redis-up-and-down.sh
@./scripts/tests/redis/test-sim-redis-up-and-down.sh
.PHONY: test-certificates
@ -234,7 +234,7 @@ test-certificates: ## Test certificate signing service and storagenode setup (je
.PHONY: test-sim-backwards-compatible
test-sim-backwards-compatible: ## Test uploading a file with lastest release (jenkins)
@echo "Running ${@}"
@./scripts/test-sim-backwards.sh
@./scripts/tests/backwardcompatibility/test-sim-backwards.sh
.PHONY: check-monitoring
check-monitoring: ## Check for locked monkit calls that have changed

View File

@ -1,12 +0,0 @@
set -x
mkdir -p $HOME/awscli
pushd $HOME/awscli
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
./awscli-bundle/install -b ~/bin/aws
popd
set +x

View File

@ -2,7 +2,7 @@
set -ueo pipefail
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPTDIR/utils.sh
source $SCRIPTDIR/../../utils.sh
TMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX)
@ -31,7 +31,7 @@ PRISTINE_FILES_DIR="$STORJ_NETWORK_DIR/pristine/$BUCKET"
DOWNLOAD_FILES_DIR="$STORJ_NETWORK_DIR/download/$BUCKET"
# override configured access with access where address is node ID + satellite addess
STORJ_ACCESS=$(go run "$SCRIPTDIR"/update-access.go "$SATELLITE_0_DIR" "$GATEWAY_0_ACCESS")
STORJ_ACCESS=$(go run "$SCRIPTDIR"/../../update-access.go "$SATELLITE_0_DIR" "$GATEWAY_0_ACCESS")
UPLINK_ACCESS="$STORJ_ACCESS"
export STORJ_ACCESS

View File

@ -2,7 +2,7 @@
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPTDIR/postgres-dev.sh
source $SCRIPTDIR/../postgres-dev.sh
export STORJ_MIGRATION_DB="${STORJ_SIM_POSTGRES}&options=--search_path=satellite/0/meta"

View File

@ -2,6 +2,6 @@
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPTDIR/postgres-dev.sh
source $SCRIPTDIR/../postgres-dev.sh
$SCRIPTDIR/test-sim.sh

View File

@ -12,7 +12,7 @@ cleanup(){
trap cleanup EXIT
echo "Running test-sim"
make -C "$SCRIPTDIR"/.. install-sim
make -C "$SCRIPTDIR"/../../.. install-sim
echo "Overriding default max segment size to 6MiB"
GOBIN=$TMP go install -v -ldflags "-X 'storj.io/uplink.maxSegmentSize=6MiB'" storj.io/storj/cmd/uplink

View File

@ -1,25 +1,26 @@
#!/usr/bin/env bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPTDIR/utils.sh
source $SCRIPTDIR/../../utils.sh
TMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX)
cleanup(){
rm -rf "$TMPDIR"
uplink rm "sj://$BUCKET_WITH_ACCESS/$FOLDER_TO_SHARE_FILE/testfile"
uplink rm "sj://$BUCKET_WITH_ACCESS/another-testfile"
uplink rm "sj://$BUCKET_WITHOUT_ACCESS/another-testfile"
uplink rb "sj://$BUCKET_WITHOUT_ACCESS"
uplink rb "sj://$BUCKET_WITH_ACCESS"
rm -rf "$TMPDIR"
echo "cleaned up test successfully"
}
trap cleanup EXIT
trap 'failure ${LINENO} "$BASH_COMMAND"' ERR
export UPLINK_CONFIG_DIR=$TMPDIR/uplink
# workaround for issues with automatic accepting monitoring question
# with first run we need to accept question y/n about monitoring
export UPLINK_CONFIG_DIR=$TMPDIR/uplink
mkdir -p "$UPLINK_CONFIG_DIR"
touch "$UPLINK_CONFIG_DIR/config.ini"

View File

@ -2,7 +2,7 @@
set -ueo pipefail
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $SCRIPTDIR/utils.sh
source $SCRIPTDIR/../../utils.sh
TMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX)

View File

@ -4,6 +4,6 @@ SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
export STORJ_REDIS_PORT=7379
# shellcheck source=/postgres-dev.sh
source "${SCRIPTDIR}/postgres-dev.sh"
source "${SCRIPTDIR}/../postgres-dev.sh"
"${SCRIPTDIR}/test-sim-redis-up-and-down.sh"

View File

@ -32,7 +32,7 @@ cleanup() {
trap cleanup ERR EXIT
echo "install sim"
make -C "$SCRIPT_DIR"/.. install-sim
make -C "$SCRIPT_DIR"/../../.. install-sim
echo "overriding default max segment size to 6MiB"
GOBIN="${TMP_DIR}" go install -v -ldflags "-X 'storj.io/uplink.maxSegmentSize=6MiB'" storj.io/storj/cmd/uplink
@ -56,4 +56,4 @@ storj-sim --failfast -x --satellites 1 --host "${STORJ_NETWORK_HOST4}" network \
# run test that checks that the satellite runs despite of not being able to connect to Redis
"${SCRIPT_DIR}/redis-server.sh" stop
storj-sim --failfast -x --satellites 1 --host "${STORJ_NETWORK_HOST4}" network \
--redis="127.0.0.1:6379" test bash "${SCRIPT_DIR}/test-uplink.sh"
--redis="127.0.0.1:6379" test bash "${SCRIPT_DIR}/../integration/test-uplink.sh"

View File

@ -4,7 +4,8 @@ set +x
# constants
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
source $SCRIPT_DIR/utils.sh
source $SCRIPT_DIR/../../utils.sh
readonly SCRIPT_DIR
BUCKET="bucket-123"