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

Build failing #270

Closed
panosru opened this Issue Feb 5, 2019 · 18 comments

Comments

Projects
None yet
3 participants
@panosru
Copy link
Contributor

panosru commented Feb 5, 2019

I'm trying to build the following project: https://github.com/omegad-biz/fault-manager/tree/develop

but it fails:
image

My .php-censor.yml file is:

build_settings:
  directory: ./src
  ignore:
    - ./vendor
    - ./tests
    - ./docs
    - ./build
    - ./_compiled
  allowed_warnings: -1

setup:
  composer:
    action: install

test:

  php_unit:
    config:
      - phpunit.xml.dist
    directories:
      - tests
    coverage: true

  security_checker: ~

  php_parallel_lint: ~

  pdepend: ~

  phan: ~

  php_code_sniffer:
    standard: PSR2
    allowed_errors: -1

  php_cpd: ~

  php_docblock_checker: ~

  php_loc: ~

  php_mess_detector:
    rules:
      - cleancode
      - controversial
      - codesize
      - design
      - naming
      - unusedcode

  technical_debt: ~

failure:
  email:
    committer: true
    default_mailto_address: panosru@me.com

complete:
  email:
    default_mailto_address: panosru@me.com

I'm not sure why it does not see composer.json since it is in place, also I'm getting Exception: Address in mailbox given [] does not comply with RFC 2822, 3.6.2. but the email is correct.

Build with debug:

Args: ["cd .. && git clone --recursive  -b \"%s\" \"%s\" \"%s\"","develop","https:/github.com/omegad-biz/fault-manager.git","<BUILD_PATH>/"]
Command: cd .. && git clone --recursive  -b "develop" "https:/github.com/omegad-biz/fault-manager.git" "<BUILD_PATH>/"
sh: 0: getcwd() failed: No such file or directory
Cloning into '<PHP_CENSOR_PATH>/runtime/builds/3/65_b358d515'...

Execution status: 0
Args: ["cd \"%s\" && git checkout %s --quiet","<BUILD_PATH>/","2f7a806d0b5dedfabf1f344d2107f846f085708f"]
Command: cd "<BUILD_PATH>/" && git checkout 2f7a806d0b5dedfabf1f344d2107f846f085708f --quiet
Execution status: 0
Args: ["cd \"%s\" && git rev-parse HEAD","<BUILD_PATH>/"]
Command: cd "<BUILD_PATH>/" && git rev-parse HEAD
2f7a806d0b5dedfabf1f344d2107f846f085708f
Execution status: 0
Args: ["cd \"%s\" && git log -1 --pretty=format:%%s %s","<BUILD_PATH>/","2f7a806d0b5dedfabf1f344d2107f846f085708f"]
Command: cd "<BUILD_PATH>/" && git log -1 --pretty=format:%s 2f7a806d0b5dedfabf1f344d2107f846f085708f
add php-censor.yml
Execution status: 0
Args: ["cd \"%s\" && git log -1 --pretty=format:%%ae %s","<BUILD_PATH>/","2f7a806d0b5dedfabf1f344d2107f846f085708f"]
Command: cd "<BUILD_PATH>/" && git log -1 --pretty=format:%ae 2f7a806d0b5dedfabf1f344d2107f846f085708f
panoskosmidis87@gmail.com
Execution status: 0
Build config from repository (.php-censor.yml)
Final config: {"build_settings":{"directory":"./src","ignore":["./vendor","./tests","./docs","./build","./_compiled"],"allowed_warnings":-1},"setup":{"composer":{"action":"install"}},"test":{"php_unit":{"config":["phpunit.xml.dist"],"directories":["tests"],"coverage":true},"security_checker":null,"php_parallel_lint":null,"pdepend":null,"phan":null,"php_code_sniffer":{"standard":"PSR2","allowed_errors":-1},"php_cpd":null,"php_docblock_checker":null,"php_loc":null,"php_mess_detector":{"rules":["cleancode","controversial","codesize","design","naming","unusedcode"]},"technical_debt":null},"failure":{"email":{"committer":true,"default_mailto_address":"panosru@me.com"}},"complete":{"email":{"default_mailto_address":"panosru@me.com"}}}
Working copy created: <BUILD_PATH>/

RUNNING PLUGIN: Composer (Stage: Setup)
Directory: <BUILD_PATH>/src/
Plugin options: {"action":"install"}
Looking for binary: composer, priority = local
Found in  (system): composer
Args: ["/usr/local/bin/composer --no-ansi --no-interaction  --working-dir=\"%s\" %s","<BUILD_PATH>/src/","install"]
Command: /usr/local/bin/composer --no-ansi --no-interaction  --working-dir="<BUILD_PATH>/src/" install
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https:/getcomposer.org/xdebug
Do not run Composer as root/super user! See https:/getcomposer.org/root for details
Composer could not find a composer.json file in <BUILD_PATH>/src
To initialize a project, please create a composer.json file as described in the https:/getcomposer.org/ "Getting Started" section

Execution status: 1
PLUGIN: FAILED
Exception: Plugin failed: composer

RUNNING PLUGIN: Email (Stage: Failure)
Directory: <BUILD_PATH>/src/
Plugin options: {"committer":true,"default_mailto_address":"panosru@me.com"}
Committer email: 'panoskosmidis87@gmail.com'
Committer option: 'true'
Addresses option: 'false'
Default mailTo option: 'panosru@me.com'
SMTP: 'false'
Exception: Address in mailbox given [] does not comply with RFC 2822, 3.6.2.
PLUGIN: FAILED (ALLOWED)

BUILD FAILED!

RUNNING PLUGIN: Email (Stage: Complete)
Directory: <BUILD_PATH>/src/
Plugin options: {"default_mailto_address":"panosru@me.com"}
Committer email: 'panoskosmidis87@gmail.com'
Committer option: 'false'
Addresses option: 'false'
Default mailTo option: 'panosru@me.com'
SMTP: 'false'
Exception: Address in mailbox given [] does not comply with RFC 2822, 3.6.2.
PLUGIN: FAILED (ALLOWED)

REMOVING BUILD.

Project settings:
image

The right section To make it easier to get started, we've generated an SSH key... empty and does not generate any ssh key...

Thanks!

@corpsee

This comment has been minimized.

Copy link
Member

corpsee commented Feb 5, 2019

@panosru I guess issue in the your OS/environment. My build log of your repo:

Клонирование в «<PHP_CENSOR_PATH>/runtime/builds/3/125_8cf1588d»…

145ba733cd34dc1f64a2598c36f8db03474d3480
Release of new version 1.4.2
panoskosmidis87@gmail.com
Working copy created: <BUILD_PATH>/

RUNNING PLUGIN: Composer (Stage: Setup)
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 42 installs, 0 updates, 0 removals
  - Installing hoa/exception (2.17.08.30): Downloading (100%)
  - Installing hoa/consistency (2.17.08.29): Downloading (100%)
  - Installing hoa/event (2.17.08.30): Downloading (100%)
  - Installing league/flysystem (1.0.44): Downloading (100%)
  - Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
  - Installing roave/signature (1.0.0): Downloading (100%)
  - Installing phpdocumentor/type-resolver (0.4.0): Loading from cache
  - Installing symfony/polyfill-ctype (v1.10.0): Loading from cache
  - Installing webmozart/assert (1.4.0): Loading from cache
  - Installing phpdocumentor/reflection-docblock (4.3.0): Loading from cache
  - Installing nikic/php-parser (v4.2.0): Loading from cache
  - Installing roave/better-reflection (3.2.0): Downloading (100%)
  - Installing zendframework/zend-eventmanager (3.2.1): Downloading (100%)
  - Installing zendframework/zend-code (3.3.1): Downloading (100%)
  - Installing hamcrest/hamcrest-php (v2.0.0): Downloading (100%)
  - Installing mockery/mockery (1.2.0): Downloading (100%)
  - Installing phpunit/php-token-stream (3.0.1): Loading from cache
  - Installing sebastian/version (2.0.1): Loading from cache
  - Installing sebastian/resource-operations (2.0.1): Loading from cache
  - Installing sebastian/recursion-context (3.0.0): Loading from cache
  - Installing sebastian/object-reflector (1.1.1): Loading from cache
  - Installing sebastian/object-enumerator (3.0.3): Loading from cache
  - Installing sebastian/global-state (2.0.0): Loading from cache
  - Installing sebastian/exporter (3.1.0): Loading from cache
  - Installing sebastian/environment (4.0.1): Loading from cache
  - Installing sebastian/diff (3.0.1): Loading from cache
  - Installing sebastian/comparator (3.0.2): Loading from cache
  - Installing phpunit/php-timer (2.0.0): Loading from cache
  - Installing phpunit/php-text-template (1.2.1): Loading from cache
  - Installing phpunit/php-file-iterator (2.0.2): Loading from cache
  - Installing theseer/tokenizer (1.1.0): Loading from cache
  - Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache
  - Installing phpunit/php-code-coverage (6.1.4): Loading from cache
  - Installing doctrine/instantiator (1.1.0): Loading from cache
  - Installing phpspec/prophecy (1.8.0): Loading from cache
  - Installing phar-io/version (2.0.1): Loading from cache
  - Installing phar-io/manifest (1.0.3): Loading from cache
  - Installing myclabs/deep-copy (1.8.1): Loading from cache
  - Installing phpunit/phpunit (7.5.2): Loading from cache
  - Installing symfony/polyfill-php72 (v1.10.0): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.10.0): Loading from cache
  - Installing symfony/var-dumper (v4.2.2): Loading from cache
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)
roave/better-reflection suggests installing composer/composer (Required to use the ComposerSourceLocator)
zendframework/zend-eventmanager suggests installing container-interop/container-interop (^1.1.0, to use the lazy listeners feature)
zendframework/zend-eventmanager suggests installing zendframework/zend-stdlib (^2.7.3 || ^3.0, to use the FilterChain feature)
zendframework/zend-code suggests installing doctrine/annotations (Doctrine\Common\Annotations >=1.0 for annotation features)
zendframework/zend-code suggests installing zendframework/zend-stdlib (Zend\Stdlib component)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit suggests installing ext-soap (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0)
symfony/var-dumper suggests installing symfony/console (To use the ServerDumpCommand and/or the bin/var-dump-server script)
Generating autoload files

PLUGIN: SUCCESS

RUNNING PLUGIN: Technical Debt (Stage: Test)
...............X.......                                       23/23 (100 %)
Checked 23 files
Found 2 instances of TODO, FIXME, TO DO, FIX ME
PLUGIN: SUCCESS

RUNNING PLUGIN: PHP Docblock Checker (Stage: Test)
[{"type":"return-missing","file":"src/Plugins/CompiledExceptions.php","class":"Omega\\FaultManager\\Plugins\\CompiledExceptions","method":"setFilesystem","line":34},{"type":"param-mismatch","file":"src/Abstracts/FaultManagerException.php","class":"Omega\\FaultManager\\Abstracts\\FaultManagerException","method":"__construct","line":40,"param":"$message","param-type":"string|null","doc-type":"null|string"},{"type":"param-mismatch","file":"src/Abstracts/FaultManagerException.php","class":"Omega\\FaultManager\\Abstracts\\FaultManagerException","method":"__construct","line":40,"param":"$previous","param-type":"Throwable|null","doc-type":"null|Throwable"},{"type":"return-missing","file":"src/Abstracts/FaultManagerException.php","class":"Omega\\FaultManager\\Abstracts\\FaultManagerException","method":"send","line":65},{"type":"param-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"exception","line":41,"param":"$exceptionClass"},{"type":"param-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"exception","line":41,"param":"$message"},{"type":"param-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"exception","line":41,"param":"$code"},{"type":"param-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"exception","line":41,"param":"$previous"},{"type":"param-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"exception","line":41,"param":"$arguments"},{"type":"return-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"exception","line":41},{"type":"param-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"throw","line":145,"param":"$exceptionClass"},{"type":"param-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"throw","line":145,"param":"$message"},{"type":"param-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"throw","line":145,"param":"$code"},{"type":"param-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"throw","line":145,"param":"$previous"},{"type":"param-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"throw","line":145,"param":"$arguments"},{"type":"return-missing","file":"src/Fault.php","class":"Omega\\FaultManager\\Fault","method":"throw","line":145},{"type":"return-missing","file":"tests/unit/BaseErrorTest.php","class":"Omega\\FaultManagerTests\\BaseErrorTest","method":"isThrowable","line":29},{"type":"return-missing","file":"tests/unit/InvalidCompilePathTest.php","class":"Omega\\FaultManagerTests\\InvalidCompilePathTest","method":"isThrowable","line":29},{"type":"return-missing","file":"tests/unit/CompiledExceptionsTest.php","class":"Omega\\FaultManagerTests\\CompiledExceptionsTest","method":"setInvalidFilesystem","line":31},{"type":"return-missing","file":"tests/unit/CompiledExceptionsTest.php","class":"Omega\\FaultManagerTests\\CompiledExceptionsTest","method":"setValidFilesystem","line":40},{"type":"return-missing","file":"tests/unit/CompiledExceptionsTest.php","class":"Omega\\FaultManagerTests\\CompiledExceptionsTest","method":"checkIfMethodNameIsValid","line":59},{"type":"return-missing","file":"tests/unit/CompiledExceptionsTest.php","class":"Omega\\FaultManagerTests\\CompiledExceptionsTest","method":"listContentsIsCalled","line":68},{"type":"return-missing","file":"tests/unit/CompiledExceptionsTest.php","class":"Omega\\FaultManagerTests\\CompiledExceptionsTest","method":"returnFiltered","line":108},{"type":"return-missing","file":"tests/unit/EventHandlerAlreadyExistsTest.php","class":"Omega\\FaultManagerTests\\EventHandlerAlreadyExistsTest","method":"isThrowable","line":29},{"type":"return-missing","file":"tests/unit/NamespacedErrorExceptionTest.php","class":"Omega\\FaultManagerTests\\NamespacedErrorExceptionTest","method":"isThrowable","line":30},{"type":"return-missing","file":"tests/unit/ExceptionNameIsEmptyTest.php","class":"Omega\\FaultManagerTests\\ExceptionNameIsEmptyTest","method":"isThrowable","line":30},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"checkThatConstructorIsPrivate","line":43},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"throwsExceptionThatIsAlreadyDefined","line":56},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"doNotCompileAlreadyDefinedExceptions","line":65},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"throwsCustomException","line":79},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"customExceptionsAreInstanceOfPhpBuildInExceptionByDefault","line":93},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"throwsExistingNamespacedException","line":106},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"eventStreamIsDisabledByDefault","line":115},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"enableAndDisableEventStream","line":130},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"registerAndUnregisterEventHandler","line":146},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"registerExistingEventHandlerWithoutOverride","line":168},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"registerExistingEventHandlerWithOverride","line":181},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"registerEventHandler","line":204},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"routeToEventStreamNonEventException","line":226},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"checkIfCustomEventPassedToEventStream","line":261},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"customExceptionIsInstanceOfFaultExceptionWhenEventStreamIsEnabled","line":296},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"throwsExceptionIfNamespacedCustomExceptionIsProvided","line":311},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"throwsExceptionIfNoExceptionNameIsGiven","line":321},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"classIsNotThrowableThusAnExceptionMustBeThrown","line":333},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"interpolateNonEventExceptionMessage","line":346},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"checkThrowsMethod","line":358},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"throwEventExceptionWithArguments","line":370},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"checkCompilePath","line":387},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"handleInvalidPath","line":400},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"checkAutoloader","line":411},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"checkCompiler","line":448},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"disableFaultEventStreamIfEnabled","line":480},{"type":"return-missing","file":"tests/unit/FaultTest.php","class":"Omega\\FaultManagerTests\\FaultTest","method":"checkIfTestingExceptionAlreadyExistsAndDeleteIt","line":509}]
Number of error : 53
PLUGIN: SUCCESS

RUNNING PLUGIN: PHP LOC (Stage: Test)
phploc 4.0.1 by Sebastian Bergmann.
Directories                                          6
Files                                               23
Size
  Lines of Code (LOC)                             1922
  Comment Lines of Code (CLOC)                     705 (36.68%)
  Non-Comment Lines of Code (NCLOC)               1217 (63.32%)
  Logical Lines of Code (LLOC)                     376 (19.56%)
    Classes                                        288 (76.60%)
      Average Class Length                          12
        Minimum Class Length                         0
        Maximum Class Length                       116
      Average Method Length                          3
        Minimum Method Length                        0
        Maximum Method Length                       17
    Functions                                        0 (0.00%)
      Average Function Length                        0
    Not in classes or functions                     88 (23.40%)
Cyclomatic Complexity
  Average Complexity per LLOC                     0.16
  Average Complexity per Class                    3.65
    Minimum Class Complexity                      1.00
    Maximum Class Complexity                     15.00
  Average Complexity per Method                   1.83
    Minimum Method Complexity                     1.00
    Maximum Method Complexity                    14.00
Dependencies
  Global Accesses                                    0
    Global Constants                                 0 (0.00%)
    Global Variables                                 0 (0.00%)
    Super-Global Variables                           0 (0.00%)
  Attribute Accesses                                50
    Non-Static                                      22 (44.00%)
    Static                                          28 (56.00%)
  Method Calls                                     261
    Non-Static                                     127 (48.66%)
    Static                                         134 (51.34%)
Structure
  Namespaces                                         7
  Interfaces                                         3
  Traits                                             4
  Classes                                           16
    Abstract Classes                                 1 (6.25%)
    Concrete Classes                                15 (93.75%)
  Methods                                           76
    Scope
      Non-Static Methods                            46 (60.53%)
      Static Methods                                30 (39.47%)
    Visibility
      Public Methods                                61 (80.26%)
      Non-Public Methods                            15 (19.74%)
  Functions                                          5
    Named Functions                                  0 (0.00%)
    Anonymous Functions                              5 (100.00%)
  Constants                                          6
    Global Constants                                 0 (0.00%)
    Class Constants                                  6 (100.00%)
PLUGIN: SUCCESS

RUNNING PLUGIN: PHP Mess Detector (Stage: Test)
PLUGIN: SUCCESS

RUNNING PLUGIN: PHP Parallel Lint (Stage: Test)
PHP 7.2.14 | 10 parallel jobs
.......................                                      23/23 (100 %)
Checked 23 files in 0.20000000000000001 seconds
No syntax error found
PLUGIN: SUCCESS

RUNNING PLUGIN: PHP Code Sniffer (Stage: Test)
PLUGIN: SUCCESS

RUNNING PLUGIN: SensioLabs Security Checker (Stage: Test)
PLUGIN: SUCCESS

RUNNING PLUGIN: PHP Unit (Stage: Test)
PHPUnit 7.5.2 by Sebastian Bergmann and contributors.
Runtime:       PHP 7.2.14-1+ubuntu18.04.1+deb.sury.org+1 with Xdebug 2.6.1
Configuration: <BUILD_PATH>/phpunit.xml.dist
Omega\FaultManagerTests\BaseError
. [x] Is throwable
Omega\FaultManagerTests\CompiledExceptions
..... [x] Set invalid filesystem
 [x] Set valid filesystem
 [x] Check if method name is valid
 [x] List contents is called
 [x] Return filtered
Omega\FaultManagerTests\EventHandlerAlreadyExists
. [x] Is throwable
Omega\FaultManagerTests\ExceptionNameIsEmpty
. [x] Is throwable
Omega\FaultManagerTests\Fault
......................... [x] Check that constructor is private
 [x] Throws exception that is already defined
 [x] Do not compile already defined exceptions
 [x] Throws custom exception
 [x] Custom exceptions are instance of php build in exception by default
 [x] Throws existing namespaced exception
 [x] Event stream is disabled by default
 [x] Enable and disable event stream
 [x] Register and unregister event handler
 [x] Register existing event handler without override
 [x] Register existing event handler with override
 [x] Register event handler
 [x] Route to event stream non event exception
 [x] Check if custom event passed to event stream
 [x] Custom exception is instance of fault exception when event stream is enabled
 [x] Throws exception if namespaced custom exception is provided
 [x] Throws exception if no exception name is given
 [x] Class is not throwable thus an exception must be thrown
 [x] Interpolate non event exception message
 [x] Check throws method
 [x] Throw event exception with arguments
 [x] Check compile path
 [x] Handle invalid path
 [x] Check autoloader
 [x] Check compiler
Omega\FaultManagerTests\InvalidCompilePath
. [x] Is throwable
Omega\FaultManagerTests\NamespacedErrorException
.                               35 / 35 (100%) [x] Is throwable
Time: 4.5300000000000002 seconds, Memory: 20.00MB
OK (35 tests, 83 assertions)
Generating code coverage report in Clover XML format ... done
Generating code coverage report in HTML format ... done
Generating code coverage report in PHP format ... done
Code Coverage Report:      
  2019-02-05 23:55:57      
                           
 Summary:                  
  Classes: 71.43% (5/7)    
  Methods: 91.67% (22/24)  
  Lines:   98.37% (121/123)
\Omega\FaultManager::Omega\FaultManager\Fault
  Methods:  50.00% ( 1/ 2)   Lines:  97.14% ( 34/ 35)
\Omega\FaultManager\Abstracts::Omega\FaultManager\Abstracts\FaultManagerException
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  7/  7)
\Omega\FaultManager\Exceptions::Omega\FaultManager\Exceptions\BaseError
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
\Omega\FaultManager\Exceptions::Omega\FaultManager\Exceptions\EventHandlerAlreadyExists
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
\Omega\FaultManager\Exceptions::Omega\FaultManager\Exceptions\ExceptionNameIsEmpty
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
\Omega\FaultManager\Exceptions::Omega\FaultManager\Exceptions\InvalidCompilePath
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
\Omega\FaultManager\Exceptions::Omega\FaultManager\Exceptions\NamespaceError
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
\Omega\FaultManager\Plugins::Omega\FaultManager\Plugins\CompiledExceptions
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 15/ 15)
\Omega\FaultManager\Plugins::Omega\FaultManager\Plugins\RouteExceptions
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
\Omega\FaultManager\Traits::FaultEventStream
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 34/ 34)
\Omega\FaultManager\Traits::FaultGenerator
  Methods:  88.89% ( 8/ 9)   Lines:  96.15% ( 25/ 26)
\Omega\FaultManager\Traits::FaultMutator
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
\Omega\FaultManager\Traits::FaultReflector
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
PLUGIN: SUCCESS

RUNNING PLUGIN: PHP Copy/Paste Detector (Stage: Test)
phpcpd 2.0.4 by Sebastian Bergmann.
0.00% duplicated lines out of 1922 total lines of code.
Time: 64 ms, Memory: 6.00MB
PLUGIN: SUCCESS

BUILD SUCCESS!

REMOVING BUILD.
@panosru

This comment has been minimized.

Copy link
Contributor Author

panosru commented Feb 5, 2019

The master branch works for me as well, but in master branch I have not phpcensor yml file, I have it on develop branch, and it fails :(

@panosru

This comment has been minimized.

Copy link
Contributor Author

panosru commented Feb 5, 2019

It seems that I was missing ssh in my container after I recreated it to update phpcensor.

image

But php-censor does not generate an ssh key for me as it did on previous version, thus I'm getting:

root@c061b4c256fc:~# git clone --recursive  -b "develop" "https:/github.com/omegad-biz/fault-manager.git"
Cloning into 'fault-manager'...
ssh: Could not resolve hostname https: Temporary failure in name resolution
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Also I don't know why mail plugin complains Exception: Address in mailbox given [] does not comply with RFC 2822, 3.6.2.....

Update

Adding a new project generates the ssh keys, it seems that because the current project field was saved empty, it does not generate the ssh key for it so I copied the ones from the new project form

Update

Still not working.. :(

Args: ["export GIT_SSH=\"/tmp/sh_WmvBir\" && cd .. && git clone --recursive  -b \"%s\" \"%s\" \"%s\"","develop","ssh:/git@github.com/omegad-biz/fault-manager.git","<BUILD_PATH>/"]
Command: export GIT_SSH="/tmp/sh_WmvBir" && cd .. && git clone --recursive  -b "develop" "ssh:/git@github.com/omegad-biz/fault-manager.git" "<BUILD_PATH>/"
sh: 0: getcwd() failed: No such file or directory
Cloning into '<PHP_CENSOR_PATH>/runtime/builds/4/69_c97552c2'...

Execution status: 0
Args: ["cd \"%s\" && git rev-parse HEAD","<BUILD_PATH>/"]
Command: cd "<BUILD_PATH>/" && git rev-parse HEAD
2f7a806d0b5dedfabf1f344d2107f846f085708f
Execution status: 0
Args: ["cd \"%s\" && git log -1 --pretty=format:%%s %s","<BUILD_PATH>/","2f7a806d0b5dedfabf1f344d2107f846f085708f"]
Command: cd "<BUILD_PATH>/" && git log -1 --pretty=format:%s 2f7a806d0b5dedfabf1f344d2107f846f085708f
add php-censor.yml
Execution status: 0
Args: ["cd \"%s\" && git log -1 --pretty=format:%%ae %s","<BUILD_PATH>/","2f7a806d0b5dedfabf1f344d2107f846f085708f"]
Command: cd "<BUILD_PATH>/" && git log -1 --pretty=format:%ae 2f7a806d0b5dedfabf1f344d2107f846f085708f
panoskosmidis87@gmail.com
Execution status: 0
Build config from repository (.php-censor.yml)
Final config: {"build_settings":{"directory":"./src","ignore":["./vendor","./tests","./docs","./build","./_compiled"],"allowed_warnings":-1},"setup":{"composer":{"action":"install"}},"test":{"php_unit":{"config":["phpunit.xml.dist"],"directories":["tests"],"coverage":true},"security_checker":null,"php_parallel_lint":null,"pdepend":null,"phan":null,"php_code_sniffer":{"standard":"PSR2","allowed_errors":-1},"php_cpd":null,"php_docblock_checker":null,"php_loc":null,"php_mess_detector":{"rules":["cleancode","controversial","codesize","design","naming","unusedcode"]},"technical_debt":null},"failure":{"email":{"committer":true,"default_mailto_address":"panosru@me.com"}},"complete":{"email":{"default_mailto_address":"panosru@me.com"}}}
Working copy created: <BUILD_PATH>/

RUNNING PLUGIN: Composer (Stage: Setup)
Directory: <BUILD_PATH>/src/
Plugin options: {"action":"install"}
Looking for binary: composer, priority = local
Found in  (system): composer
Args: ["/usr/local/bin/composer --no-ansi --no-interaction  --working-dir=\"%s\" %s","<BUILD_PATH>/src/","install"]
Command: /usr/local/bin/composer --no-ansi --no-interaction  --working-dir="<BUILD_PATH>/src/" install
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https:/getcomposer.org/xdebug
Do not run Composer as root/super user! See https:/getcomposer.org/root for details
Composer could not find a composer.json file in <BUILD_PATH>/src
To initialize a project, please create a composer.json file as described in the https:/getcomposer.org/ "Getting Started" section

Execution status: 1
PLUGIN: FAILED
Exception: Plugin failed: composer

RUNNING PLUGIN: Email (Stage: Failure)
Directory: <BUILD_PATH>/src/
Plugin options: {"committer":true,"default_mailto_address":"panosru@me.com"}
Committer email: 'panoskosmidis87@gmail.com'
Committer option: 'true'
Addresses option: 'false'
Default mailTo option: 'panosru@me.com'
SMTP: 'false'
Exception: Address in mailbox given [] does not comply with RFC 2822, 3.6.2.
PLUGIN: FAILED (ALLOWED)

BUILD FAILED!

RUNNING PLUGIN: Email (Stage: Complete)
Directory: <BUILD_PATH>/src/
Plugin options: {"default_mailto_address":"panosru@me.com"}
Committer email: 'panoskosmidis87@gmail.com'
Committer option: 'false'
Addresses option: 'false'
Default mailTo option: 'panosru@me.com'
SMTP: 'false'
Exception: Address in mailbox given [] does not comply with RFC 2822, 3.6.2.
PLUGIN: FAILED (ALLOWED)

REMOVING BUILD.
@corpsee

This comment has been minimized.

Copy link
Member

corpsee commented Feb 5, 2019

You shouldn't use build_settings.directory: ./src for all plugins because Composer plugin looks for composer.json in the global directory too.

@panosru

This comment has been minimized.

Copy link
Contributor Author

panosru commented Feb 5, 2019

Ah I see, it does affect the setup also, I thought it affects the test only. That means that I have to set directory separately in each test plugin in order to have the desired result, that is kind of inconvenient, is it not?

@corpsee

This comment has been minimized.

Copy link
Member

corpsee commented Feb 5, 2019

Try to overload global directory option for Composer:

build_settings:
  directory: ./src
  ignore:
    - ./vendor
    - ./tests
    - ./docs
    - ./build
    - ./_compiled
  allowed_warnings: -1

setup:
  composer:
    directory: ./
    action: install
@panosru

This comment has been minimized.

Copy link
Contributor Author

panosru commented Feb 5, 2019

@corpsee it was the first thing I did, unfortunately, it didn't work.

My config looks like this now:

build_settings:
  ignore:
    - ./vendor
    - ./tests
    - ./docs
    - ./build
    - ./_compiled
  allowed_warnings: -1

setup:
  composer:
    action: install

test:

  php_unit:
    config:
      - phpunit.xml.dist
    directories:
      - tests
    coverage: true

  security_checker: ~

  php_parallel_lint:
    directory: ./src

  pdepend:
    directory: ./src

  phan:
    directory: ./src

  php_code_sniffer:
    standard: PSR2
    allowed_errors: -1

  php_cpd:
    directory: ./src

  php_docblock_checker:
    directory: ./src

  php_loc:
    directory: ./src

  php_mess_detector:
    directory: ./src
    rules:
      - cleancode
      - controversial
      - codesize
      - design
      - naming
      - unusedcode

  technical_debt:
    directory: ./src

failure:
  email:
    committer: true
    default_mailto_address: panosru@me.com

complete:
  email:
    default_mailto_address: panosru@me.com

Seems to work, except the email part:

image

corpsee added a commit that referenced this issue Feb 5, 2019

corpsee added a commit that referenced this issue Feb 5, 2019

@corpsee

This comment has been minimized.

Copy link
Member

corpsee commented Feb 5, 2019

@panosru I fixed directory overloading in branches release-1.0 and master. The fix will be released with version 1.0.5.

@corpsee

This comment has been minimized.

Copy link
Member

corpsee commented Feb 5, 2019

@panosru Thanks!

@panosru

This comment has been minimized.

Copy link
Contributor Author

panosru commented Feb 5, 2019

@corpsee Thanks!

From my testing I ended up in the following issues:

1st: PHP Coding Standards Fixer even though it is installed:
image
image

2nd: Phan cannot process the generated report:
image
image

3rd: Emails not working, complaining about RFC
image
config:

failure:
  email:
    committer: true
    default_mailto_address: "panosru@me.com"

4th: Slack notifications not working:

RUNNING PLUGIN: Slack (Stage: Complete)
Directory: <BUILD_PATH>/
Plugin options: {"webhook_url":"https:/hooks.slack.com/services/***","room":"#php-censor","username":"PHP Censor","icon":":ghost:","message":"%PROJECT_TITLE% - build %BUILD% succeeded! :smiley:","show_status":false}
Exception: Warning: count(): Parameter must be an array or an object that implements Countable in <PHP_CENSOR_PATH>/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 67
PLUGIN: FAILED (ALLOWED)

config:

complete:

  slack_notify:
    webhook_url: "https://hooks.slack.com/services/****"
    room: "#php-censor"
    username: "PHP Censor"
    icon: ":ghost:"
    message: "%PROJECT_TITLE% - build %BUILD% succeeded! :smiley:"
    show_status: false

5th: Mage binary not found:
image

image

Thanks!

@garas

This comment has been minimized.

Copy link

garas commented Feb 6, 2019

What are your php-censor.email_settings in app/config.yml? Mailer receives empty ([]) email, so invalid. Maybe it is From address.

corpsee added a commit that referenced this issue Feb 6, 2019

@corpsee

This comment has been minimized.

Copy link
Member

corpsee commented Feb 6, 2019

@panosru I updated Guzzle version for normal Slack's working in branch slack-fix. Could you check my changes for Slack plugin please (You should also call composer install after change branch)?

@panosru

This comment has been minimized.

Copy link
Contributor Author

panosru commented Feb 7, 2019

I'm sorry for my late reply,

@garas

here are my email settings:

php-censor:
  email_settings:
    from_address: info@***
    smtp_address: smtp.gmail.com
    smtp_port: 587
    smtp_username: info@***
    smtp_password: ***
    default_mailto_address: info@***
    smtp_encryption: tls

The settings are tested with https://www.smtper.net and they are working fine, I use the same settings in other web apps and they are working fine.

@corpsee
My slack settings for testing purposes:

success:
  slack_notify:
    webhook_url: "https://hooks.slack.com/services/***"
    room: "#php-censor"
    username: "PHP Censor"
    icon: ":ghost:"
    message: "%PROJECT_TITLE% - build %BUILD% succeeded! :smiley:"
    show_status: false
    
failure:
  slack_notify:
    webhook_url: "https://hooks.slack.com/services/***"
    room: "#php-censor"
    username: "PHP Censor"
    icon: ":ghost:"
    message: "%PROJECT_TITLE% - build %BUILD% failed! :sleepy:"
    show_status: false
    
complete:
  slack_notify:
    webhook_url: "https://hooks.slack.com/services/***"
    room: "#php-censor"
    username: "PHP Censor"
    icon: ":ghost:"
    message: "%PROJECT_TITLE% - build %BUILD% finished."
    show_status: true

Php censor result:
image

Slack results:
image

Php censor run with debug:
image

@corpsee

This comment has been minimized.

Copy link
Member

corpsee commented Feb 8, 2019

@panosru Are you sure that you test branch slack-fix? Your error from master because you didn't run new migrations.

UPDATE: My apologies, it's my fault. I fixed branch slack-fix now. Could you test branch again please?

corpsee added a commit that referenced this issue Feb 8, 2019

@panosru

This comment has been minimized.

Copy link
Contributor Author

panosru commented Feb 8, 2019

@corpsee yup, guzzle 6.3 worked fine, slack now works without any issues.

Indeed I forgot the migrations, my apologies as well.

The emails though are not working.

@corpsee

This comment has been minimized.

Copy link
Member

corpsee commented Feb 8, 2019

@panosru Thanks!

@panosru

This comment has been minimized.

Copy link
Contributor Author

panosru commented Feb 9, 2019

@corpsee and @garas

Well, tbh I didn't pay attention to RFC 2822, which indicates that the correct format should be John Doe <john.doe@gmail.com> rather than just john.doe@gmail.com.

Now that I fixed that in my email_settings.from_address I got:
image

Thanks!

@panosru panosru closed this Feb 9, 2019

@corpsee

This comment has been minimized.

Copy link
Member

corpsee commented Feb 9, 2019

@panosru Thank you for details!

I fixed behavior of from_address and now addresses like 'john.doe@gmail.com' will be automatically transform to 'PHP Censor john.doe@gmail.com'.

All fixes from the issue (parent_id, Slack, Email) merged in the branches release-1.0 and master and will be released with version 1.0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment