Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Testing #3787

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions .github/phpunit-webtest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="bootstrapInstall.php">

<testsuites>
<testsuite name="Browser Tests">
<directory suffix="Web.php">../tests/install</directory>
<directory suffix="Web.php">../tests/headless</directory>
</testsuite>
</testsuites>
<testsuites>
<testsuite name="Browser Tests">
<directory suffix="Web.php">../tests/install</directory>
<directory suffix="Web.php">../tests/headless</directory>
</testsuite>
</testsuites>

<coverage includeUncoveredFiles="false">
<include>
<directory suffix=".php">../sources</directory>
</include>
<exclude>
<directory suffix=".php">../sources/ext</directory>
</exclude>
<report>
<clover outputFile="/tmp/web.xml"/>
</report>
</coverage>
<coverage includeUncoveredFiles="false">
<include>
<directory suffix=".php">../sources</directory>
</include>
<exclude>
<directory suffix=".php">../sources/ext</directory>
</exclude>
<report>
<clover outputFile="/tmp/web.xml"/>
</report>
</coverage>

<php>
<const name="DBTYPE" value="MySQL"/>
<const name="PHPUNIT_SELENIUM" value="true"/>
<const name="PHPUNIT_TESTSUITE" value="true"/>
</php>
<php>
<const name="DBTYPE" value="MySQL"/>
<const name="PHPUNIT_SELENIUM" value="true"/>
<const name="PHPUNIT_TESTSUITE" value="true"/>
</php>

</phpunit>
4 changes: 3 additions & 1 deletion .github/setup-failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ set +x
# Passed params
DB=$1
PHP_VERSION=$2
CODECOV_TOKEN=$3

# Agents will merge all coverage data...
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]
then
bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.clover'
bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "${CODECOV_TOKEN}"
#bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.clover'
fi
58 changes: 45 additions & 13 deletions .github/setup-selenium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,52 @@
set -e
set -x

# Passed params
# Access passed params
DB=$1
PHP_VERSION=$2
CODECOV_TOKEN=$3

# Per actions in the tests.yaml file
# Some vars to make this easy to change
SELENIUM_HUB_URL='http://127.0.0.1:4444'
SELENIUM_JAR=/usr/share/selenium/selenium-server-standalone.jar
SELENIUM_DOWNLOAD_URL=https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar

# Location of geckodriver for use as webdriver in xvfb
GECKODRIVER_DOWNLOAD_URL=https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz
GECKODRIVER_TAR=/tmp/geckodriver.tar.gz

# Location of chromedriver for use as webdriver in xvfb
CHROMEDRIVER_ZIP=/tmp/chromedriver_linux64.zip

# Download Selenium
echo "Downloading Selenium"
sudo mkdir -p $(dirname "$SELENIUM_JAR")
sudo wget -nv -O "$SELENIUM_JAR" "$SELENIUM_DOWNLOAD_URL"
sudo chmod 777 "$SELENIUM_JAR"

# Install Chrome
echo "Installing Browser"

# Available Chrome Versions
# https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable?id=202706
#
# Current Versions for Ref
# Selenium 3.141.59 jar
# Chrome 123.0.6312.58
# ChromeDriver 123.0.6312.58
CHROME_VERSION='123.0.6312.58-1'
wget https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb -q
sudo dpkg -i google-chrome-stable_${CHROME_VERSION}_amd64.deb

echo "Ensuring Selenium Started"
SELENIUM_HUB_URL='http://127.0.0.1:4444'
# Download Chrome Driver
# https://chromedriver.storage.googleapis.com/${VERSION}/chromedriver_linux64.zip"
# https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.58/linux64/chromedriver-linux64.zip
#echo "Downloading chromedriver"
CHROME_VERSION=$(google-chrome --version) \
&& wget -nv -O "$CHROMEDRIVER_ZIP" "https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.58/linux64/chromedriver-linux64.zip" \
&& unzip "$CHROMEDRIVER_ZIP" \
&& sudo mv chromedriver-linux64/chromedriver /usr/local/bin/chromedriver \
&& sudo chmod +x /usr/local/bin/chromedriver \
&& chromedriver --version

# Start Selenium using default chosen webdriver
export DISPLAY=:99.0
xvfb-run --server-args="-screen 0, 2560x1440x24" java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar "$SELENIUM_JAR" > /tmp/selenium.log &
wget --retry-connrefused --tries=120 --waitretry=3 --output-file=/dev/null "$SELENIUM_HUB_URL/wd/hub/status" -O /dev/null

# Test to see if the selenium server really did start
Expand All @@ -45,8 +77,8 @@ else
vendor/bin/phpunit --verbose --debug --configuration .github/phpunit-webtest.xml

# Agents will merge all coverage data...
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]
then
bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "${CODECOV_TOKEN}"
fi
# if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]
# then
# bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "${CODECOV_TOKEN}"
# fi
fi
Loading
Loading