Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wcms_tests
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
wcms_tests
Commits
31d44d08
Commit
31d44d08
authored
3 months ago
by
Eric Bremner
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-7160: update run files to create site and use sql file
parent
10b60092
No related branches found
No related tags found
2 merge requests
!83
ISTWCMS-7160 Fix service content type in testAutomaticListBlocksSettings in...
,
!81
ISTWCMS-7160 Make existing Codeception tests pass
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
run_files.sh
+34
-20
34 additions, 20 deletions
run_files.sh
with
34 additions
and
20 deletions
run_files.sh
+
34
−
20
View file @
31d44d08
rm
-rf
tests/_output
rm
-rf
tests/_data
# Ensure we are not using the recorder.
cp
tests/acceptance_norecorder.suite.yml tests/acceptance.suite.yml
while
getopts
'r'
OPTION
;
do
while
getopts
'r'
OPTION
;
do
case
"
$OPTION
"
in
case
"
$OPTION
"
in
r
)
r
)
...
@@ -19,9 +13,29 @@ while getopts 'r' OPTION; do
...
@@ -19,9 +13,29 @@ while getopts 'r' OPTION; do
esac
esac
done
done
# Remove all the old test data.
rm
-rf
tests/_output
rm
-rf
tests/_data
# Ensure we are not using the recorder.
cp
tests/acceptance_norecorder.suite.yml tests/acceptance.suite.yml
# Generate a file name for the sql file.
sqlfile
=
$(
cat
/proc/sys/kernel/random/uuid
)
sqlfile
=
"
$sqlfile
.sql"
# Install a site and get an sql file from site install.
echo
"*********************************************************"
echo
"Installing site ..."
drush si uw_base_profile
--db-url
=
mysql://drupal:drupal@mariadb/drupal
--account-name
=
wcmsadmin
--account-pass
=
a
--site-name
=
"WCMS Test"
-y
drush sql-dump
>
"
$sqlfile
"
echo
"Done installing site."
echo
"*********************************************************"
# Directory to iterate through
# Directory to iterate through
directory
=
"tests/acceptance"
directory
=
"tests/acceptance"
# Get the file names of the tests.
files
=()
files
=()
for
file
in
"
$directory
"
/
*
;
do
for
file
in
"
$directory
"
/
*
;
do
if
[[
-f
"
$file
"
]]
;
then
if
[[
-f
"
$file
"
]]
;
then
...
@@ -31,30 +45,30 @@ for file in "$directory"/*; do
...
@@ -31,30 +45,30 @@ for file in "$directory"/*; do
fi
fi
done
done
drush sql-dump
>
start.sql
# Perform the tests using the files.
# Perform the tests using the groups
for
value
in
"
${
files
[@]
}
"
;
do
for
value
in
"
${
files
[@]
}
"
;
do
pgrep chrome | xargs
kill
-9
echo
"*********************************************************"
echo
"**************************************"
echo
"Current Test:
$value
"
echo
"Current Test:
$value
"
echo
"**************************************"
echo
"*********************************************************"
echo
"Waiting ..."
echo
"Setting up site ..."
sleep
10s
pgrep chrome | xargs
kill
-9
echo
"Done waiting."
echo
"**************************************"
echo
"Installing site ..."
drush sql-drop
-y
drush sql-drop
-y
drush sql-cli < start.sql
drush sql-cli <
"
$sqlfile
"
echo
"Done installing site."
echo
"**************************************"
chromedriver
--port
=
9515
--url-base
=
/wd/hub &
chromedriver
--port
=
9515
--url-base
=
/wd/hub &
echo
"Done setting up site."
echo
"*********************************************************"
echo
"Starting test ...
$value
"
if
[[
$stepper
==
1
]]
;
then
if
[[
$stepper
==
1
]]
;
then
php vendor/bin/codecept run acceptance
"
$value
"
--fail-fast
--steps
php vendor/bin/codecept run acceptance
"
$value
"
--fail-fast
--steps
else
else
php vendor/bin/codecept run acceptance
"
$value
"
--fail-fast
php vendor/bin/codecept run acceptance
"
$value
"
--fail-fast
fi
fi
if
[[
$?
-ne
0
]]
;
then
if
[[
$?
-ne
0
]]
;
then
rm
"
$sqlfile
"
echo
"Test
$value
failed, done test."
echo
"*********************************************************"
break
break
fi
fi
echo
"Done test
$value
."
echo
"*********************************************************"
done
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment