Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !4858
An error occurred while fetching the assigned milestone of the selected merge_request.

[Slim4] Add integration tests

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/ybelenko/slim4-ci-script into master 5 years ago
  • Overview 0
  • Commits 3
  • Pipelines 0
  • Changes 5

Created by: ybelenko

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

I didn't add run of PHP_CodeSniffer(popular PHP linter) on purpose. I think that there will be code styling issues which cannot be solved automatically because of mustaches. For instance I had problems with multiline mustache values. If value contains line breaks and indentations I cannot align it with other parts of the script. PHP_CodeSniffer will always complain about wrong indentations, so integration test will be failed. Anyway, syntax check + unit tests gives 100% workable build, while code formatting may be not perfect.

Current integration test process:

  1. Composer dependencies install
  2. Full PHP syntax check by phplint package
  3. Tests run by PHPUnit.
Compare
  • master (base)

and
  • latest version
    d4ca6199
    3 commits, 2 years ago

5 files
+ 32
- 2640

    Preferences

    File browser
    Compare changes
modules/…/…/…/…/‎php-slim4-server‎
.giti‎gnore‎ +1 -1
samples/server/p‎etstore/php-slim4‎
.giti‎gnore‎ +1 -1
compos‎er.lock‎ +0 -2626
php_syntax_‎checker.bash‎ +0 -11
pom‎.xml‎ +30 -1
modules/openapi-generator/src/main/resources/php-slim4-server/.gitignore
+ 1
- 1
  • View file @ d4ca6199

  • Edit in single-file editor

  • Open in Web IDE


@@ -5,7 +5,7 @@ composer.phar
@@ -5,7 +5,7 @@ composer.phar
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
composer.lock
# phplint tool creates cache file which is not necessary in a codebase
# phplint tool creates cache file which is not necessary in a codebase
/.phplint-cache
/.phplint-cache
samples/server/petstore/php-slim4/.gitignore
+ 1
- 1
  • View file @ d4ca6199

  • Edit in single-file editor

  • Open in Web IDE


@@ -5,7 +5,7 @@ composer.phar
@@ -5,7 +5,7 @@ composer.phar
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
composer.lock
# phplint tool creates cache file which is not necessary in a codebase
# phplint tool creates cache file which is not necessary in a codebase
/.phplint-cache
/.phplint-cache
samples/server/petstore/php-slim4/composer.lock deleted 100644 → 0
+ 0
- 2626
  • View file @ a95e3e36

Files with large changes are collapsed by default.

samples/server/petstore/php-slim4/php_syntax_checker.bash deleted 100755 → 0
+ 0
- 11
  • View file @ a95e3e36

#!/bin/bash
# a simple script to perform a syntax check on php files using "php -l"
for i in $( find . -name "*.php" ); do
result=`php -l $i | grep "No syntax errors detected"`
exit_status=$?
if [ $exit_status -eq 1 ]; then
echo "Syntax errors with $i"
exit 1;
fi
done
samples/server/petstore/php-slim4/pom.xml
+ 30
- 1
  • View file @ d4ca6199

  • Edit in single-file editor

  • Open in Web IDE


@@ -26,6 +26,19 @@
@@ -26,6 +26,19 @@
<artifactId>exec-maven-plugin</artifactId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<version>1.2.1</version>
<executions>
<executions>
 
<execution>
 
<id>bundle-install</id>
 
<phase>pre-integration-test</phase>
 
<goals>
 
<goal>exec</goal>
 
</goals>
 
<configuration>
 
<executable>composer</executable>
 
<arguments>
 
<argument>install</argument>
 
</arguments>
 
</configuration>
 
</execution>
<execution>
<execution>
<id>syntax-check</id>
<id>syntax-check</id>
<phase>integration-test</phase>
<phase>integration-test</phase>
@@ -33,7 +46,23 @@
@@ -33,7 +46,23 @@
<goal>exec</goal>
<goal>exec</goal>
</goals>
</goals>
<configuration>
<configuration>
<executable>./php_syntax_checker.bash</executable>
<executable>composer</executable>
 
<arguments>
 
<argument>phplint</argument>
 
</arguments>
 
</configuration>
 
</execution>
 
<execution>
 
<id>bundle-test</id>
 
<phase>integration-test</phase>
 
<goals>
 
<goal>exec</goal>
 
</goals>
 
<configuration>
 
<executable>composer</executable>
 
<arguments>
 
<argument>test</argument>
 
</arguments>
</configuration>
</configuration>
</execution>
</execution>
</executions>
</executions>
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference:
Source branch: github/fork/ybelenko/slim4-ci-script

Menu

Explore Projects Groups Snippets