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
c52fb7e2
Commit
c52fb7e2
authored
3 weeks ago
by
Eric Bremner
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-7189: Update scripts to only have one that works now
parent
929ec27c
No related branches found
No related tags found
1 merge request
!83
ISTWCMS-7160 Fix service content type in testAutomaticListBlocksSettings in...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
run_tests.sh
+107
-78
107 additions, 78 deletions
run_tests.sh
setup_codeception.sh
+0
-2
0 additions, 2 deletions
setup_codeception.sh
with
107 additions
and
80 deletions
run_tests.sh
+
107
−
78
View file @
c52fb7e2
rm
-rf
tests/_output
rm
-rf
tests/_data
codecoverage
=
0
stepper
=
0
debugger
=
0
testname
=
""
# Set the variables to start.
endtoend
=
0
;
stepper
=
0
;
installsite
=
0
;
testname
=
""
;
cp
tests/acceptance_norecorder.suite.yml tests/acceptance.suite.yml
while
getopts
'crsdt:'
OPTION
;
do
# Get the options from the command line.
while
getopts
'rsiet:'
OPTION
;
do
case
"
$OPTION
"
in
r
)
cp
tests/acceptance_recorder.suite.yml tests/acceptance.suite.yml
;;
c
)
codecoverage
=
1
;;
s
)
stepper
=
1
;;
d
)
debugger
=
1
i
)
installsite
=
1
;;
e
)
endtoend
=
1
;;
t
)
testname
=
$OPTARG
;;
?
)
echo
"script usage: [-
c] [-r] [-s] [-d] [-t] <TestName>
"
>
&2
echo
"script usage: [-
rsiet]
"
>
&2
exit
1
;;
esac
done
if
[
$stepper
==
0
]
&&
[
$codecoverage
==
0
]
;
then
if
[
$debugger
==
1
]
;
then
if
[
$testname
]
;
then
php vendor/bin/codecept run acceptance
$testname
--fail-fast
--debug
else
php vendor/bin/codecept run acceptance
--fail-fast
--debug
fi
else
if
[
$testname
]
;
then
php vendor/bin/codecept run acceptance
$testname
--fail-fast
else
php vendor/bin/codecept run acceptance
--fail-fast
fi
fi
# Ensure that we have either end to end or specific test.
if
[[
$endtoend
==
0
]]
&&
[[
$testname
==
""
]]
;
then
echo
"You must specify a test if not using end to end tests"
;
exit
1
;
fi
;
# 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
if
[[
$installsite
==
1
]]
;
then
# 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
"*********************************************************"
fi
if
[
$stepper
==
1
]
&&
[
$codecoverage
==
1
]
;
then
if
[
$debugger
==
1
]
;
then
if
[
$testname
]
;
then
php vendor/bin/codecept run acceptance
$testname
--steps
--coverage-html
--fail-fast
--debug
else
php vendor/bin/codecept run acceptance
--steps
--coverage-html
--fail-fast
--debug
fi
else
if
[
$testname
]
;
then
php vendor/bin/codecept run acceptance
$testname
--steps
--coverage-html
--fail-fast
else
php vendor/bin/codecept run acceptance
--steps
--coverage-html
--fail-fast
fi
fi
else
if
[
$stepper
==
1
]
;
then
if
[
$debugger
==
1
]
;
then
if
[
$testname
]
;
then
php vendor/bin/codecept run acceptance
$testname
--steps
--fail-fast
--debug
else
php vendor/bin/codecept run acceptance
--steps
--fail-fast
--debug
fi
else
if
[
$testname
]
;
then
php vendor/bin/codecept run acceptance
$testname
--steps
--fail-fast
else
php vendor/bin/codecept run acceptance
--steps
--fail-fast
if
[[
$endtoend
==
1
]]
;
then
# Directory to iterate through
directory
=
"tests/acceptance"
# Get the file names of the tests.
files
=()
for
file
in
"
$directory
"
/
*
;
do
if
[[
-f
"
$file
"
]]
;
then
file
=
"
${
file
//tests\/acceptance\//
}
"
file
=
"
${
file
//\.php/
}
"
files+
=(
"
$file
"
)
fi
fi
done
else
files
=(
"
$testname
"
)
fi
# Perform the tests using the files.
for
value
in
"
${
files
[@]
}
"
;
do
echo
"*********************************************************"
echo
"Current Test:
$value
"
echo
"*********************************************************"
if
[[
$endtoend
==
1
]]
;
then
echo
"Stopping chrome driver ..."
echo
"*********************************************************"
pgrep chrome | xargs
kill
-9
fi
if
[
$codecoverage
==
1
]
;
then
if
[
$debugger
==
1
]
;
then
if
[
$testname
]
;
then
php vendor/bin/codecept run acceptance
$testname
--coverage-html
--debug
else
php vendor/bin/codecept run acceptance
--coverage-html
--debug
fi
else
if
[
$testname
]
;
then
php vendor/bin/codecept run acceptance
$testname
--coverage-html
--fail-fast
else
php vendor/bin/codecept run acceptance
--coverage-html
--fail-fast
fi
fi
if
[[
$installsite
==
1
]]
;
then
echo
"Dropping database ..."
echo
"*********************************************************"
drush sql-drop
-y
echo
"Importing database ..."
echo
"*********************************************************"
drush sql-cli <
"
$sqlfile
"
fi
fi
files
=(
tests/_output/
*
.fail.html
)
if
[[
$endtoend
==
1
]]
;
then
echo
"Starting chrome driver ..."
echo
"*********************************************************"
chromedriver
--port
=
9515
--url-base
=
/wd/hub &
echo
"Sleeping ..."
echo
"*********************************************************"
sleep
15s
echo
""
fi
if
[
-e
"
${
files
[0]
}
"
]
;
then
sed
-i
--
's/link rel\=\"stylesheet\" media\=\"all\" href\=\"\/core/link rel\=\"stylesheet\" media\=\"all\" href\=\"\.\.\/\.\.\/web\/core/g'
tests/_output/
*
.fail.html
sed
-i
--
's/link rel\=\"stylesheet\" media\=\"all\" href\=\"\/profiles/link rel\=\"stylesheet\" media\=\"all\" href\=\"\.\.\/\.\.\/web\/profiles/g'
tests/_output/
*
.fail.html
fi
echo
"*********************************************************"
echo
"Starting test ...
$value
"
echo
"*********************************************************"
if
[[
$stepper
==
1
]]
;
then
php vendor/bin/codecept run acceptance
"
$value
"
--fail-fast
--steps
else
php vendor/bin/codecept run acceptance
"
$value
"
--fail-fast
fi
if
[[
$installsite
==
1
]]
;
then
if
[[
$?
-ne
0
]]
;
then
rm
"
$sqlfile
"
echo
""
echo
"*********************************************************"
echo
"Test
$value
failed, done test."
echo
"*********************************************************"
echo
""
break
fi
fi
echo
""
echo
"*********************************************************"
echo
"Done test
$value
."
echo
"*********************************************************"
echo
""
done
This diff is collapsed.
Click to expand it.
setup_codeception.sh
+
0
−
2
View file @
c52fb7e2
...
...
@@ -3,6 +3,4 @@ cp tests/c3.php .
cp
tests/codeception.yml
.
cp
tests/index.php web
cp
tests/run_tests.sh
.
cp
tests/run_groups.sh
.
cp
tests/run_files.sh
.
sed
-i
's/self::COVERAGE_COOKIE,\s$value,\s$cookieParams/self::COVERAGE_COOKIE, $value/g'
/var/www/html/vendor/codeception/codeception/src/Codeception/Coverage/Subscriber/LocalServer.php
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