Skip to content

Commit de611ef

Browse files
added buildspec.test.yml and logging for AWS Codebuild-based unittests & reports
1 parent 6ff32cf commit de611ef

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

buildspec.test.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: '0.2'
2+
phases:
3+
install:
4+
runtime-versions:
5+
php: '7.3'
6+
commands:
7+
- docker-compose build
8+
# install using integrated composer
9+
- docker-compose -f docker-compose.unittest.yml run --no-deps unittest-php73 composer update
10+
# alternatively: install on agent, w/o platform checks
11+
# - composer update --ignore-platform-reqs --no-progress --no-interaction
12+
13+
build:
14+
commands:
15+
- docker-compose -f docker-compose.unittest.yml up unittest-php73
16+
17+
# full run including coverage report
18+
# - docker-compose -f docker-compose.unittest.yml run unittest-php73 vendor/bin/phpunit
19+
20+
post_build:
21+
commands:
22+
# just for safety, cleanup.
23+
- docker-compose stop
24+
25+
reports:
26+
test-report:
27+
files:
28+
- .phpunit/report.junit.xml
29+
file-format: JunitXml

phpunit.xml

+4
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@
4343
<directory suffix=".php">tests/validator</directory>
4444
</testsuite>
4545
</testsuites>
46+
<logging>
47+
<!-- required for AWS CodeBuild reports -->
48+
<junit outputFile=".phpunit/report.junit.xml" />
49+
</logging>
4650
</phpunit>

0 commit comments

Comments
 (0)