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
1 month 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
# Set the variables to start.
rm
-rf
tests/_data
endtoend
=
0
;
stepper
=
0
;
codecoverage
=
0
installsite
=
0
;
stepper
=
0
testname
=
""
;
debugger
=
0
testname
=
""
cp
tests/acceptance_norecorder.suite.yml tests/acceptance.suite.yml
# Get the options from the command line.
while
getopts
'rsiet:'
OPTION
;
do
while
getopts
'crsdt:'
OPTION
;
do
case
"
$OPTION
"
in
case
"
$OPTION
"
in
r
)
r
)
cp
tests/acceptance_recorder.suite.yml tests/acceptance.suite.yml
cp
tests/acceptance_recorder.suite.yml tests/acceptance.suite.yml
;;
;;
c
)
codecoverage
=
1
;;
s
)
s
)
stepper
=
1
stepper
=
1
;;
;;
d
)
i
)
debugger
=
1
installsite
=
1
;;
e
)
endtoend
=
1
;;
;;
t
)
t
)
testname
=
$OPTARG
testname
=
$OPTARG
;;
;;
?
)
?
)
echo
"script usage: [-
c] [-r] [-s] [-d] [-t] <TestName>
"
>
&2
echo
"script usage: [-
rsiet]
"
>
&2
exit
1
exit
1
;;
;;
esac
esac
done
done
if
[
$stepper
==
0
]
&&
[
$codecoverage
==
0
]
;
then
# Ensure that we have either end to end or specific test.
if
[
$debugger
==
1
]
;
then
if
[[
$endtoend
==
0
]]
&&
[[
$testname
==
""
]]
;
then
if
[
$testname
]
;
then
echo
"You must specify a test if not using end to end tests"
;
php vendor/bin/codecept run acceptance
$testname
--fail-fast
--debug
exit
1
;
else
fi
;
php vendor/bin/codecept run acceptance
--fail-fast
--debug
fi
# Remove all the old test data.
else
rm
-rf
tests/_output
if
[
$testname
]
;
then
rm
-rf
tests/_data
php vendor/bin/codecept run acceptance
$testname
--fail-fast
else
# Ensure we are not using the recorder.
php vendor/bin/codecept run acceptance
--fail-fast
cp
tests/acceptance_norecorder.suite.yml tests/acceptance.suite.yml
fi
fi
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
fi
if
[
$stepper
==
1
]
&&
[
$codecoverage
==
1
]
;
then
if
[[
$endtoend
==
1
]]
;
then
if
[
$debugger
==
1
]
;
then
if
[
$testname
]
;
then
# Directory to iterate through
php vendor/bin/codecept run acceptance
$testname
--steps
--coverage-html
--fail-fast
--debug
directory
=
"tests/acceptance"
else
php vendor/bin/codecept run acceptance
--steps
--coverage-html
--fail-fast
--debug
# Get the file names of the tests.
fi
files
=()
else
for
file
in
"
$directory
"
/
*
;
do
if
[
$testname
]
;
then
if
[[
-f
"
$file
"
]]
;
then
php vendor/bin/codecept run acceptance
$testname
--steps
--coverage-html
--fail-fast
file
=
"
${
file
//tests\/acceptance\//
}
"
else
file
=
"
${
file
//\.php/
}
"
php vendor/bin/codecept run acceptance
--steps
--coverage-html
--fail-fast
files+
=(
"
$file
"
)
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
fi
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
fi
if
[
$codecoverage
==
1
]
;
then
if
[
$debugger
==
1
]
;
then
if
[[
$installsite
==
1
]]
;
then
if
[
$testname
]
;
then
echo
"Dropping database ..."
php vendor/bin/codecept run acceptance
$testname
--coverage-html
--debug
echo
"*********************************************************"
else
drush sql-drop
-y
php vendor/bin/codecept run acceptance
--coverage-html
--debug
echo
"Importing database ..."
fi
echo
"*********************************************************"
else
drush sql-cli <
"
$sqlfile
"
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
fi
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
echo
"*********************************************************"
sed
-i
--
's/link rel\=\"stylesheet\" media\=\"all\" href\=\"\/core/link rel\=\"stylesheet\" media\=\"all\" href\=\"\.\.\/\.\.\/web\/core/g'
tests/_output/
*
.fail.html
echo
"Starting test ...
$value
"
sed
-i
--
's/link rel\=\"stylesheet\" media\=\"all\" href\=\"\/profiles/link rel\=\"stylesheet\" media\=\"all\" href\=\"\.\.\/\.\.\/web\/profiles/g'
tests/_output/
*
.fail.html
echo
"*********************************************************"
fi
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 .
...
@@ -3,6 +3,4 @@ cp tests/c3.php .
cp
tests/codeception.yml
.
cp
tests/codeception.yml
.
cp
tests/index.php web
cp
tests/index.php web
cp
tests/run_tests.sh
.
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
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