diff --git a/.aliases b/.aliases index 2fb7e74e..0ca84c79 100644 --- a/.aliases +++ b/.aliases @@ -1,4 +1,4 @@ -# For using the alias gw-importOfficeData or gw-importHostingAssets, +# For using the alias gw-importHostingAssets, # copy the file .tc-environment to .environment (ignored by git) # and amend them according to your external DB. @@ -71,7 +71,6 @@ function importLegacyData() { ./gradlew $target --rerun fi } -alias gw-importOfficeData='importLegacyData importOfficeData' alias gw-importHostingAssets='importLegacyData importHostingAssets' alias podman-start='systemctl --user enable --now podman.socket && systemctl --user status podman.socket && ls -la /run/user/$UID/podman/podman.sock' @@ -90,11 +89,54 @@ alias pg-sql-restore='gunzip --stdout | docker exec -i hsadmin-ng-postgres psql alias fp='grep -r '@Accepts' src | sed -e 's/^.*@/@/g' | sort -u | wc -l' alias gw-spotless='./gradlew spotlessApply -x pitest -x test -x :processResources' -alias gw-test='. .aliases; ./gradlew test' -alias gw-check='. .aliases; gw test check -x pitest' +alias gw-check='. .aliases; . .tc-environment; gw test check -x pitest' + +# HOWTO: run all 'normal' tests (by default without scenario+import-tests): `gw-test` +# You can also mention specific targets: `gw-test importHostingAssets`, in that case only these tests are executed. +# This will always use the environment from `.tc-environment`. +# +# HOWTO: re-run tests even if no changed can be detected: `gw-test --rerun` +# You can also mention specific targets: `gw-test scenarioTest --rerun`. +# This will always use the environment from `.tc-environment`. +# +# HOWTO: run all tests (unit, integration+acceptance, import and scenario): `gw-test --all` +# You can also re-run all these tests, which will take ~20min: `gw-test --all --rerun` +# This will always use the environment from `.tc-environment`. +# +function _gwTest1() { + echo + printf -- '=%0.s' {1..80}; echo + echo "RUNNING gw $@" + printf -- '-%0.s' {1..80}; echo + ./gradlew "$@" + printf -- '-%0.s' {1..80}; echo + echo "DONE gw $@" +} +function _gwTest() { + . .aliases + . .tc-environment + rm -f /tmp/gwTest.tmp + if [ "$1" == "--all" ]; then + shift # to remove the --all from $@ + # delierately in separate gradlew-calls to avoid Testcontains-PostgreSQL problem spillover + time (_gwTest1 unitTest "$@" && + _gwTest1 officeIntegrationTest bookingIntegrationTest hostingIntegrationTest "$@" && + _gwTest1 scenarioTest "$@" && + _gwTest1 importHostingAssets "$@"); + elif [ $# -eq 0 ] || [[ $1 == -* ]]; then + time _gwTest1 test "$@"; + else + time _gwTest1 "$@"; + fi + printf -- '=%0.s' {1..80}; echo +} +alias gw-test=_gwTest + +alias howto=bin/howto +alias cas-curl=bin/cas-curl # etc/docker-compose.yml limits CPUs+MEM and includes a PostgreSQL config for analysing slow queries -alias gw-importOfficeData-in-docker-compose=' +alias gw-importHostingAssets-in-docker-compose=' docker-compose -f etc/docker-compose.yml down && docker-compose -f etc/docker-compose.yml up -d && sleep 10 && time gw-importHostingAssets' @@ -104,5 +146,6 @@ if [ ! -f .environment ]; then fi source .environment -alias scenario-reports-upload='./gradlew scenarioTests convertMarkdownToHtml && ssh hsh03-hsngdev@h50.hostsharing.net "rm -f doms/hsngdev.hs-example.de/htdocs-ssl/scenarios/office/*.html" && scp build/doc/scenarios/*.html hsh03-hsngdev@h50.hostsharing.net:doms/hsngdev.hs-example.de/htdocs-ssl/scenarios/office' +alias scenario-reports-upload='./gradlew scenarioTest convertMarkdownToHtml && ssh hsh03-hsngdev@h50.hostsharing.net "rm -f doms/hsngdev.hs-example.de/htdocs-ssl/scenarios/office/*.html" && scp build/doc/scenarios/*.html hsh03-hsngdev@h50.hostsharing.net:doms/hsngdev.hs-example.de/htdocs-ssl/scenarios/office' alias scenario-reports-open='open https://hsngdev.hs-example.de/scenarios/office' + diff --git a/.run/ImportHostingAssets into local.run.xml b/.run/ImportHostingAssets into local.run.xml index d3c7f2da..956ca15d 100644 --- a/.run/ImportHostingAssets into local.run.xml +++ b/.run/ImportHostingAssets into local.run.xml @@ -7,6 +7,7 @@ +