diff --git a/services/swh-scheduler-worker/entrypoint.sh b/services/swh-scheduler-worker/entrypoint.sh index 697cd0f..1ed0b2b 100755 --- a/services/swh-scheduler-worker/entrypoint.sh +++ b/services/swh-scheduler-worker/entrypoint.sh @@ -1,21 +1,21 @@ #!/bin/bash set -e source /srv/softwareheritage/utils/pyutils.sh setup_pip source /srv/softwareheritage/utils/pgsql.sh setup_pgsql case "$1" in "shell") exec bash -i ;; *) wait_pgsql echo "Starting the swh-scheduler $1" - exec wait-for-it amqp:5672 -s --timeout=0 -- swh-scheduler --log-level ${LOGLEVEL} -C /scheduler.yml $@ + exec wait-for-it amqp:5672 -s --timeout=0 -- swh --log-level ${LOGLEVEL} scheduler -C /scheduler.yml $@ ;; esac diff --git a/tests/test_01_loader_git.sh b/tests/test_01_loader_git.sh index 7342050..cfcf49d 100644 --- a/tests/test_01_loader_git.sh +++ b/tests/test_01_loader_git.sh @@ -1,70 +1,70 @@ #!/bin/bash shopt -s nullglob extglob TEST_GIT_REPO_NAME="swh-loader-tar" TEST_GIT_REPO_URL="https://forge.softwareheritage.org/source/${TEST_GIT_REPO_NAME}.git" status_message "Scheduling the loading of the git repository located at ${TEST_GIT_REPO_URL}" -docker-compose $DOCO_OPTIONS exec -T swh-scheduler-api swh-scheduler task add origin-update-git repo_url=$TEST_GIT_REPO_URL +docker-compose $DOCO_OPTIONS exec -T swh-scheduler-api swh scheduler task add origin-update-git repo_url=$TEST_GIT_REPO_URL status_message "Waiting for the git loading task to complete" wait_for_service_output 300 swh-loader "swh.loader.git.tasks.UpdateGitRepository.*succeeded" status_message "The loading task has been successfully executed" status_message "Getting all git objects contained in the repository" git clone $TEST_GIT_REPO_URL cd $TEST_GIT_REPO_NAME cd "$(git rev-parse --git-path objects)" for p in pack/pack-*([0-9a-f]).idx ; do git show-index < $p | cut -f 2 -d ' ' > $WORKDIR/git_objects done for o in [0-9a-f][0-9a-f]/*([0-9a-f]) ; do echo ${o/\/} >> $WORKDIR/git_objects done declare -ga CONTENTS declare -ga DIRECTORIES declare -ga REVISIONS declare -ga RELEASES while IFS='' read -r object || [[ -n "$object" ]]; do object_type=$(git cat-file -t $object) if [ "$object_type" = "blob" ]; then CONTENTS+=($object) elif [ "$object_type" = "tree" ]; then DIRECTORIES+=($object) elif [ "$object_type" = "commit" ]; then REVISIONS+=($object) elif [ "$object_type" = "tag" ]; then RELEASES+=($object) fi done < $WORKDIR/git_objects status_message "Checking all git objects have been successfully loaded into the archive" status_message "Checking contents" for content in "${CONTENTS[@]}"; do http_request_check GET ${SWH_WEB_API_BASEURL}/content/sha1_git:$content/ done status_message "All contents have been successfully loaded into the archive" status_message "Checking directories" for directory in "${DIRECTORIES[@]}"; do http_request_check GET ${SWH_WEB_API_BASEURL}/directory/$directory/ done status_message "All directories have been successfully loaded into the archive" status_message "Checking revisions" for revision in "${REVISIONS[@]}"; do http_request_check GET ${SWH_WEB_API_BASEURL}/revision/$revision/ done status_message "All revisions have been successfully loaded into the archive" status_message "Checking releases" for release in "${RELEASES[@]}"; do http_request_check GET ${SWH_WEB_API_BASEURL}/release/$release/ done status_message "All releases have been successfully loaded into the archive"