Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gitlab-ci
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
gitlab-ci
Commits
958fa550
Verified
Commit
958fa550
authored
7 months ago
by
Bartek Jaskulski
Browse files
Options
Downloads
Patches
Plain Diff
refactor: cleanup unit test job
Signed-off-by:
Bart Jaskulski
<
bjaskulski@protonmail.com
>
parent
94b1ac5e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
gitlab-ci-1.2.yml
+1
-1
1 addition, 1 deletion
gitlab-ci-1.2.yml
includes/tests/unit.yml
+19
-53
19 additions, 53 deletions
includes/tests/unit.yml
with
20 additions
and
54 deletions
gitlab-ci-1.2.yml
+
1
−
1
View file @
958fa550
variables
:
variables
:
WPDESK_CI_VERSION
:
"
2024.11.
04
"
WPDESK_CI_VERSION
:
"
2024.11.
19
"
MYSQL_ROOT_PASSWORD
:
"
mysql"
MYSQL_ROOT_PASSWORD
:
"
mysql"
MYSQL_DATABASE
:
"
wptest"
MYSQL_DATABASE
:
"
wptest"
MYSQL_USER
:
"
mysql"
MYSQL_USER
:
"
mysql"
...
...
This diff is collapsed.
Click to expand it.
includes/tests/unit.yml
+
19
−
53
View file @
958fa550
.
te
mplate
:
&job-test-template
te
st:unit
:
image
:
gitlab.wpdesk.dev:5050/wpdesk/docker-tests/php-box:8.3.2
image
:
gitlab.wpdesk.dev:5050/wpdesk/docker-tests/php-box:8.3.2
variables
:
PHPUNIT_OPTIONS
:
"
--no-coverage"
tags
:
tags
:
-
unit
-
unit
stage
:
tests
stage
:
tests
except
:
rules
:
-
if
:
$IS_NPM_LIBRARY
when
:
never
-
if
:
$CI_COMMIT_BRANCH == "devel"
exists
:
-
phpunit-unit.xml
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG
exists
:
-
phpunit-unit.xml
variables
:
variables
:
-
$IS_NPM_LIBRARY
PHPUNIT_OPTIONS
:
"
--coverage-text
--coverage-html
tmp_artifacts/unit/coverage
--colors=never"
-
exists
:
-
phpunit-unit.xml
when
:
manual
coverage
:
'
/^\s*Lines:\s*\d+.\d+\%/'
coverage
:
'
/^\s*Lines:\s*\d+.\d+\%/'
artifacts
:
artifacts
:
paths
:
paths
:
-
tmp_artifacts/unit
-
tmp_artifacts/unit
reports
:
reports
:
junit
:
tmp_artifacts/unit/report.xml
junit
:
tmp_artifacts/unit/report.xml
expire_in
:
3 mos
interruptible
:
true
interruptible
:
true
.template
:
&job-test-unit-template
<<
:
*job-test-template
before_script
:
before_script
:
-
echo ${WPDESK_CI_VERSION}
-
echo ${WPDESK_CI_VERSION}
-
php --version
-
php --version
-
echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
-
echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
script
:
script
:
-
vendor/bin/phpunit
-d memory_limit=-1 --configuration phpunit-unit.xml
--coverage-text --colors=never
--log-junit tmp_artifacts/unit/report.xml
--coverage-html tmp_artifacts/unit/coverage
-
vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-unit.xml --log-junit tmp_artifacts/unit/report.xml
$PHPUNIT_OPTIONS
after_script
:
after_script
:
-
'
if
[[
${REPORTPORTAL_AUTHORIZATION}
&&
${REPORTPORTAL_PROJECT}
]];
then
curl
-X
POST
"http://195.201.225.204:8080/api/v1/${REPORTPORTAL_PROJECT}/launch/import"
-H
"accept:
*/*"
-H
"Content-Type:
multipart/form-data"
-H
"${REPORTPORTAL_AUTHORIZATION}"
-F
"file=file=@tmp_artifacts/unit/report.xml;type=text/xml;type=text/xml;filename=${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}-unit.xml";
fi'
-
'
if
[[
${REPORTPORTAL_AUTHORIZATION}
&&
${REPORTPORTAL_PROJECT}
]];
then
curl
-X
POST
"http://195.201.225.204:8080/api/v1/${REPORTPORTAL_PROJECT}/launch/import"
-H
"accept:
*/*"
-H
"Content-Type:
multipart/form-data"
-H
"${REPORTPORTAL_AUTHORIZATION}"
-F
"file=file=@tmp_artifacts/unit/report.xml;type=text/xml;type=text/xml;filename=${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}-unit.xml";
fi'
.template
:
&job-test-unit-template-fast
<<
:
*job-test-template
script
:
-
echo ${WPDESK_CI_VERSION}
-
ls -l
-
php --version
-
vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-unit.xml --no-coverage --log-junit tmp_artifacts/unit/report.xml
unit test lastest
:
<<
:
*job-test-unit-template-fast
only
:
refs
:
-
devel
-
tags
except
:
variables
:
-
$IS_NPM_LIBRARY
unit test lastest coverage
:
<<
:
*job-test-unit-template
only
:
refs
:
-
master
-
main
unit test lastest manual
:
<<
:
*job-test-unit-template-fast
when
:
manual
allow_failure
:
true
except
:
refs
:
-
devel
-
tags
variables
:
-
$DISABLE_COVERAGE
unit test lastest coverage manual
:
<<
:
*job-test-unit-template
when
:
manual
allow_failure
:
true
except
:
refs
:
-
master
-
main
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