Skip to content

Commit a2eca66

Browse files
author
David Ferlay
authored
Merge pull request #259 from skilld-labs/tests_fixes
Tests fixes
2 parents 94ac5c6 + db40765 commit a2eca66

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"drupal/upgrade_status": "^2.6",
6161
"espend/behat-placeholder-extension": "^1.1",
6262
"genesis/behat-fail-aid": "^2.1",
63-
"palantirnet/drupal-rector": "^0.5.4"
63+
"drupal/upgrade_rector": "^1"
6464
},
6565
"conflict": {
6666
"drupal/drupal": "*"

scripts/makefile/tests.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ifneq ("$(wildcard scripts/git_hooks/sniffers.sh)","")
2929
$(shell ln -sf ../../scripts/git_hooks/sniffers.sh .git/hooks/pre-push)
3030
else
3131
@echo "scripts/git_hooks/sniffers.sh file does not exist"
32+
@exit 1
3233
endif
3334
else
3435
@echo "No git directory found, git hooks won't be installed"
@@ -41,6 +42,7 @@ ifneq ("$(wildcard scripts/makefile/baseconfig-langcode.sh)","")
4142
@/bin/sh ./scripts/makefile/baseconfig-langcode.sh
4243
else
4344
@echo "scripts/makefile/baseconfig-langcode.sh file does not exist"
45+
@exit 1
4446
endif
4547

4648
## Validate configuration schema
@@ -51,6 +53,7 @@ ifneq ("$(wildcard scripts/makefile/config-inspector-validation.sh)","")
5153
@$(call php, /bin/sh ./scripts/makefile/config-inspector-validation.sh)
5254
else
5355
@echo "scripts/makefile/config-inspector-validation.sh file does not exist"
56+
@exit 1
5457
endif
5558

5659
## Validate composer.json file
@@ -66,6 +69,7 @@ ifneq ("$(wildcard scripts/makefile/hookupdateval.sh)","")
6669
@/bin/sh ./scripts/makefile/hookupdateval.sh
6770
else
6871
@echo "scripts/makefile/hookupdateval.sh.sh file does not exist"
72+
@exit 1
6973
endif
7074

7175
## Validate watchdog logs
@@ -75,6 +79,7 @@ ifneq ("$(wildcard scripts/makefile/watchdog-validation.sh)","")
7579
@$(call php, /bin/sh ./scripts/makefile/watchdog-validation.sh)
7680
else
7781
@echo "scripts/makefile/watchdog-validation.sh file does not exist"
82+
@exit 1
7883
endif
7984

8085
## Validate status report
@@ -84,6 +89,7 @@ ifneq ("$(wildcard scripts/makefile/status-report-validation.sh)","")
8489
@$(call php, /bin/sh ./scripts/makefile/status-report-validation.sh)
8590
else
8691
@echo "scripts/makefile/status-report-validation.sh file does not exist"
92+
@exit 1
8793
endif
8894

8995
## Validate drupal-rector
@@ -95,6 +101,7 @@ ifneq ("$(wildcard rector.yml)","")
95101
$(call php, vendor/bin/rector process --dry-run --no-progress-bar web/modules/custom web/themes/custom)
96102
else
97103
@echo "rector.yml file does not exist"
104+
@exit 1
98105
endif
99106

100107
## Validate upgrade-status
@@ -105,6 +112,7 @@ ifneq ("$(wildcard scripts/makefile/upgrade-status-validation.sh)","")
105112
@$(call php, /bin/sh ./scripts/makefile/upgrade-status-validation.sh)
106113
else
107114
@echo "scripts/makefile/upgrade-status-validation.sh file does not exist"
115+
@exit 1
108116
endif
109117

110118
## Validate newline at the end of files
@@ -113,6 +121,7 @@ ifneq ("$(wildcard scripts/makefile/newlineeof.sh)","")
113121
@/bin/sh ./scripts/makefile/newlineeof.sh
114122
else
115123
@echo "scripts/makefile/newlineeof.sh file does not exist"
124+
@exit 1
116125
endif
117126

118127
## Validate Behat scenarios
@@ -166,6 +175,7 @@ ifneq ("$(wildcard scripts/makefile/contentgen.sh)","")
166175
@$(call php, /bin/sh ./scripts/makefile/contentgen.sh)
167176
else
168177
@echo "scripts/makefile/watchdog-validation.sh file does not exist"
178+
@exit 1
169179
endif
170180

171181
## Run sniffer validations (executed as git hook, by scripts/git_hooks/sniffers.sh)

scripts/makefile/upgrade-status-validation.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ drush en -y upgrade_status
55

66
# Search for no issues message
77
REPORT=$(drush us-a --all --ignore-contrib --ignore-uninstalled)
8-
IS_VALID=$(echo "$REPORT" | grep "No known issues found.")
8+
IS_INVALID=$(echo "$REPORT" | grep "FILE:")
99

10-
# Exit1 and alert if message not found
11-
if [ -z "$IS_VALID" ]; then
12-
printf "There are \033[1missue(s)\033[0m in Upgrade Status report to fix : \n- Go to \033[1m/admin/reports/upgrade-status\033[0m for more details\n"
13-
echo -e "$REPORT"
14-
exit 1
15-
else
10+
# Exit 1 and alert if at least one file was reported.
11+
if [ -z "$IS_INVALID" ]; then
1612
drush pmu upgrade_status -y
1713
echo -e "Status report is valid : No error listed"
1814
exit 0
15+
else
16+
printf "There are \033[1missue(s)\033[0m in Upgrade Status report to fix : \n- Go to \033[1m/admin/reports/upgrade-status\033[0m for more details\n"
17+
echo -e "$REPORT"
18+
exit 1
1919
fi

0 commit comments

Comments
 (0)