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

Add infection task #1013

Closed
siad007 opened this issue Jan 2, 2019 · 31 comments
Closed

Add infection task #1013

siad007 opened this issue Jan 2, 2019 · 31 comments

Comments

@siad007
Copy link
Member

siad007 commented Jan 2, 2019

It would be awesome to support the mutation test framework infection with an own task.

Related to infection/infection#592

@marcelloh
Copy link

I was trying this, but stranded :-(
this is my phing build file:

<?xml version="1.0" encoding="utf-8"?>
<project name="SMART" description="SMART Command Line Interface" default="?">

	<property name="PHP_HOME" value=" C:\Development\php\php-7.2.12-nts-Win32-VC15-x64\php.exe" />

	<target name="infection">
		<echo level="warning" msg="${PHP_HOME}"/>

		<echo level="warning" msg="remove infection" />
		<delete dir="infection" includeemptydirs="true" />

		<echo level="warning" msg="infection" />

		<echo>${PHP_HOME}</echo>
		<echo level="warning" msg="phphome is [${PHP_HOME}] between brackets" />
		<exec executable="${PHP_HOME}" passthru="true" escape="false">
			<arg value="./vendor/infection/infection/bin/infection" />
			<arg value="-j5" />
			<arg value="--ansi" />
		</exec>
	</target>

	<target name="?">
		<echo level="" msg="${line.separator}
		${PHP_HOME} ${line.separator}
		------ ${line.separator}
		" />
	</target>
</project>

see my conversation here:
infection/infection#592

@siad007
Copy link
Member Author

siad007 commented Jan 2, 2019

@marcelloh some suggestons:

  • try using phing as a composer dependency like infection with dev-master branch
  • post the output from phing -debug infection
  • Remove the leading whitespace from your property

Can you post the actual phing -debug infection before?

@marcelloh
Copy link

my output:

Adding reference: phing.PropertyHelper -> PropertyHelper
Setting ro project property: phing.file -> C:\myproject\SmartCore\build.xml
Adding reference: phing.file -> PropertyValue
Setting ro project property: phing.dir -> C:\myproject\SmartCore
Adding reference: phing.dir -> PropertyValue
Buildfile: C:\myproject\SmartCore\build.xml
Adding reference: host.os -> PropertyValue
Adding reference: os.name -> PropertyValue
Adding reference: php.classpath -> PropertyValue
Adding reference: host.fstype -> PropertyValue
Adding reference: php.interpreter -> PropertyValue
Adding reference: line.separator -> PropertyValue
Adding reference: php.version -> PropertyValue
Adding reference: php.tmpdir -> PropertyValue
Adding reference: user.home -> PropertyValue
Adding reference: application.startdir -> PropertyValue
Adding reference: phing.startTime -> PropertyValue
Adding reference: host.name -> PropertyValue
Adding reference: host.arch -> PropertyValue
Adding reference: host.domain -> PropertyValue
Adding reference: host.os.release -> PropertyValue
Adding reference: host.os.version -> PropertyValue
Adding reference: phing.home -> PropertyValue
Adding reference: env.ALLUSERSPROFILE -> PropertyValue
Adding reference: env.APPDATA -> PropertyValue
Adding reference: env.CMDR -> PropertyValue
Adding reference: env.CommonProgramFiles -> PropertyValue
Adding reference: env.CommonProgramFiles(x86) -> PropertyValue
Adding reference: env.CommonProgramW6432 -> PropertyValue
Adding reference: env.COMPUTERNAME -> PropertyValue
Adding reference: env.ComSpec -> PropertyValue
Adding reference: env.DriverData -> PropertyValue
Adding reference: env.FPS_BROWSER_APP_PROFILE_STRING -> PropertyValue
Adding reference: env.FPS_BROWSER_USER_PROFILE_STRING -> PropertyValue
Adding reference: env.gopath -> PropertyValue
Adding reference: env.GOROOT -> PropertyValue
Adding reference: env.HOMEDRIVE -> PropertyValue
Adding reference: env.HOMEPATH -> PropertyValue
Adding reference: env.LIBTHAI_DICTDIR -> PropertyValue
Adding reference: env.LOCALAPPDATA -> PropertyValue
Adding reference: env.LOGONSERVER -> PropertyValue
Adding reference: env.NUMBER_OF_PROCESSORS -> PropertyValue
Adding reference: env.OneDrive -> PropertyValue
Adding reference: env.OS -> PropertyValue
Adding reference: env.Path -> PropertyValue
Adding reference: env.PATHEXT -> PropertyValue
Adding reference: env.PHP_HOME -> PropertyValue
Adding reference: env.PROCESSOR_ARCHITECTURE -> PropertyValue
Adding reference: env.PROCESSOR_IDENTIFIER -> PropertyValue
Adding reference: env.PROCESSOR_LEVEL -> PropertyValue
Adding reference: env.PROCESSOR_REVISION -> PropertyValue
Adding reference: env.ProgramData -> PropertyValue
Adding reference: env.ProgramFiles -> PropertyValue
Adding reference: env.ProgramFiles(x86) -> PropertyValue
Adding reference: env.ProgramW6432 -> PropertyValue
Adding reference: env.PROMPT -> PropertyValue
Adding reference: env.PSModulePath -> PropertyValue
Adding reference: env.PUBLIC -> PropertyValue
Adding reference: env.SESSIONNAME -> PropertyValue
Adding reference: env.SystemDrive -> PropertyValue
Adding reference: env.SystemRoot -> PropertyValue
Adding reference: env.TEMP -> PropertyValue
Adding reference: env.TMP -> PropertyValue
Adding reference: env.USERDOMAIN -> PropertyValue
Adding reference: env.USERDOMAIN_ROAMINGPROFILE -> PropertyValue
Adding reference: env.USERNAME -> PropertyValue
Adding reference: env.USERPROFILE -> PropertyValue
Adding reference: env.VBOX_MSI_INSTALL_PATH -> PropertyValue
Adding reference: env.VSCODE_CWD -> PropertyValue
Adding reference: env.what1 -> PropertyValue
Adding reference: env.what2 -> PropertyValue
Adding reference: env.windir -> PropertyValue
Adding reference: env.TERM_PROGRAM -> PropertyValue
Adding reference: env.TERM_PROGRAM_VERSION -> PropertyValue
Adding reference: env.LANG -> PropertyValue
Adding reference: env.PHP_SELF -> PropertyValue
Adding reference: env.SCRIPT_NAME -> PropertyValue
Adding reference: env.SCRIPT_FILENAME -> PropertyValue
Adding reference: env.PATH_TRANSLATED -> PropertyValue
Adding reference: env.DOCUMENT_ROOT -> PropertyValue
Adding reference: env.REQUEST_TIME_FLOAT -> PropertyValue
Adding reference: env.REQUEST_TIME -> PropertyValue
Adding reference: env.argc -> PropertyValue
Adding reference: phing.ComponentHelper -> ComponentHelper
  +Task definition: adhoc (phing.tasks.system.AdhocTask)
  +Task definition: adhoc-task (phing.tasks.system.AdhocTaskdefTask)
  +Task definition: adhoc-type (phing.tasks.system.AdhocTypedefTask)
  +Task definition: apply (phing.tasks.system.ApplyTask)
  +Task definition: append (phing.tasks.system.AppendTask)
  +Task definition: attrib (phing.tasks.system.AttribTask)
  +Task definition: available (phing.tasks.system.AvailableTask)
  +Task definition: blockfor (phing.tasks.system.BlockForTask)
  +Task definition: chmod (phing.tasks.system.ChmodTask)
  +Task definition: chown (phing.tasks.system.ChownTask)
  +Task definition: concat (phing.tasks.system.AppendTask)
  +Task definition: condition (phing.tasks.system.ConditionTask)
  +Task definition: copy (phing.tasks.system.CopyTask)
  +Task definition: delete (phing.tasks.system.DeleteTask)
  +Task definition: dirname (phing.tasks.system.Dirname)
  +Task definition: echo (phing.tasks.system.EchoTask)
  +Task definition: echoproperties (phing.tasks.system.EchoProperties)
  +Task definition: exec (phing.tasks.system.ExecTask)
  +Task definition: fail (phing.tasks.system.FailTask)
  +Task definition: foreach (phing.tasks.system.ForeachTask)
  +Task definition: includepath (phing.tasks.system.IncludePathTask)
  +Task definition: input (phing.tasks.system.InputTask)
  +Task definition: mkdir (phing.tasks.system.MkdirTask)
  +Task definition: move (phing.tasks.system.MoveTask)
  +Task definition: phing (phing.tasks.system.PhingTask)
  +Task definition: phingcall (phing.tasks.system.PhingCallTask)
  +Task definition: phingversion (phing.tasks.system.condition.PhingVersion)
  +Task definition: php (phing.tasks.system.PhpEvalTask)
  +Task definition: property (phing.tasks.system.PropertyTask)
  +Task definition: record (phing.tasks.system.RecorderTask)
  +Task definition: reflexive (phing.tasks.system.ReflexiveTask)
  +Task definition: resolvepath (phing.tasks.system.ResolvePathTask)
  +Task definition: retry (phing.tasks.system.Retry)
  +Task definition: runtarget (phing.tasks.system.RunTargetTask)
  +Task definition: sleep (phing.tasks.system.SleepTask)
  +Task definition: taskdef (phing.tasks.system.TaskdefTask)
  +Task definition: tempfile (phing.tasks.system.TempFile)
  +Task definition: touch (phing.tasks.system.TouchTask)
  +Task definition: truncate (phing.tasks.system.TruncateTask)
  +Task definition: tstamp (phing.tasks.system.TstampTask)
  +Task definition: typedef (phing.tasks.system.TypedefTask)
  +Task definition: uptodate (phing.tasks.system.UpToDateTask)
  +Task definition: xslt (phing.tasks.system.XsltTask)
  +Task definition: if (phing.tasks.system.IfTask)
  +Task definition: warn (phing.tasks.system.WarnTask)
  +Task definition: import (phing.tasks.system.ImportTask)
  +Task definition: loadfile (phing.tasks.system.LoadFileTask)
  +Task definition: switch (phing.tasks.system.SwitchTask)
  +Task definition: basename (phing.tasks.system.Basename)
  +Task definition: diagnostics (phing.tasks.system.DiagnosticsTask)
  +Task definition: pathconvert (phing.tasks.system.PathConvert)
  +Task definition: defaultexcludes (phing.tasks.system.DefaultExcludes)
  +Task definition: dependset (phing.tasks.system.DependSet)
  +Task definition: relentless (phing.tasks.system.Relentless)
  +Task definition: pdo (phing.tasks.ext.pdo.PDOSQLExecTask)
  +Task definition: pdosqlexec (phing.tasks.ext.pdo.PDOSQLExecTask)
  +Task definition: package-as-path (phing.tasks.ext.PackageAsPathTask)
  +Task definition: smarty (phing.tasks.ext.SmartyTask)
  +Task definition: tar (phing.tasks.ext.TarTask)
  +Task definition: untar (phing.tasks.ext.UntarTask)
  +Task definition: pearpkg (phing.tasks.ext.PearPackageTask)
  +Task definition: pearpkg2 (phing.tasks.ext.PearPackage2Task)
  +Task definition: mail (phing.tasks.ext.MailTask)
  +Task definition: zip (phing.tasks.ext.ZipTask)
  +Task definition: unzip (phing.tasks.ext.UnzipTask)
  +Task definition: waitfor (phing.tasks.system.WaitForTask)
  +Task definition: trycatch (phing.tasks.system.TryCatchTask)
  +Task definition: svnlastrevision (phing.tasks.ext.svn.SvnLastRevisionTask)
  +Task definition: svncheckout (phing.tasks.ext.svn.SvnCheckoutTask)
  +Task definition: svnexport (phing.tasks.ext.svn.SvnExportTask)
  +Task definition: svnupdate (phing.tasks.ext.svn.SvnUpdateTask)
  +Task definition: svnswitch (phing.tasks.ext.svn.SvnSwitchTask)
  +Task definition: svncopy (phing.tasks.ext.svn.SvnCopyTask)
  +Task definition: svncommit (phing.tasks.ext.svn.SvnCommitTask)
  +Task definition: svnlist (phing.tasks.ext.svn.SvnListTask)
  +Task definition: svnlog (phing.tasks.ext.svn.SvnLogTask)
  +Task definition: svninfo (phing.tasks.ext.svn.SvnInfoTask)
  +Task definition: svnproplist (phing.tasks.ext.svn.SvnProplistTask)
  +Task definition: svnpropget (phing.tasks.ext.svn.SvnPropgetTask)
  +Task definition: svnpropset (phing.tasks.ext.svn.SvnPropsetTask)
  +Task definition: gitarchive (phing.tasks.ext.git.GitArchiveTask)
  +Task definition: gitinit (phing.tasks.ext.git.GitInitTask)
  +Task definition: gitclone (phing.tasks.ext.git.GitCloneTask)
  +Task definition: gitgc (phing.tasks.ext.git.GitGcTask)
  +Task definition: gitbranch (phing.tasks.ext.git.GitBranchTask)
  +Task definition: gitfetch (phing.tasks.ext.git.GitFetchTask)
  +Task definition: gitmerge (phing.tasks.ext.git.GitMergeTask)
  +Task definition: gitcheckout (phing.tasks.ext.git.GitCheckoutTask)
  +Task definition: gitpull (phing.tasks.ext.git.GitPullTask)
  +Task definition: gitpush (phing.tasks.ext.git.GitPushTask)
  +Task definition: gitlog (phing.tasks.ext.git.GitLogTask)
  +Task definition: gittag (phing.tasks.ext.git.GitTagTask)
  +Task definition: gitcommit (phing.tasks.ext.git.GitCommitTask)
  +Task definition: gitdescribe (phing.tasks.ext.git.GitDescribeTask)
  +Task definition: hgadd (phing.tasks.ext.hg.HgAddTask)
  +Task definition: hgarchive (phing.tasks.ext.hg.HgArchiveTask)
  +Task definition: hgclone (phing.tasks.ext.hg.HgCloneTask)
  +Task definition: hgcommit (phing.tasks.ext.hg.HgCommitTask)
  +Task definition: hginit (phing.tasks.ext.hg.HgInitTask)
  +Task definition: hglog (phing.tasks.ext.hg.HgLogTask)
  +Task definition: hgpull (phing.tasks.ext.hg.HgPullTask)
  +Task definition: hgpush (phing.tasks.ext.hg.HgPushTask)
  +Task definition: hgrevert (phing.tasks.ext.hg.HgRevertTask)
  +Task definition: hgtag (phing.tasks.ext.hg.HgTagTask)
  +Task definition: hgupdate (phing.tasks.ext.hg.HgUpdateTask)
  +Task definition: phpunit (phing.tasks.ext.phpunit.PHPUnitTask)
  +Task definition: phpunitreport (phing.tasks.ext.phpunit.PHPUnitReportTask)
  +Task definition: coverage-setup (phing.tasks.ext.coverage.CoverageSetupTask)
  +Task definition: coverage-merger (phing.tasks.ext.coverage.CoverageMergerTask)
  +Task definition: coverage-report (phing.tasks.ext.coverage.CoverageReportTask)
  +Task definition: coverage-threshold (phing.tasks.ext.coverage.CoverageThresholdTask)
  +Task definition: ioncubeencoder (phing.tasks.ext.ioncube.IoncubeEncoderTask)
  +Task definition: ioncubelicense (phing.tasks.ext.ioncube.IoncubeLicenseTask)
  +Task definition: phplint (phing.tasks.ext.PhpLintTask)
  +Task definition: xmllint (phing.tasks.ext.XmlLintTask)
  +Task definition: analyze (phing.tasks.ext.ZendCodeAnalyzerTask)
  +Task definition: zendcodeanalyzer (phing.tasks.ext.ZendCodeAnalyzerTask)
  +Task definition: jshint (phing.tasks.ext.JsHintTask)
  +Task definition: jsllint (phing.tasks.ext.JslLintTask)
  +Task definition: manifest (phing.tasks.ext.ManifestTask)
  +Task definition: phpcodesniffer (phing.tasks.ext.PhpCodeSnifferTask)
  +Task definition: phpcpd (phing.tasks.ext.phpcpd.PHPCPDTask)
  +Task definition: phploc (phing.tasks.ext.phploc.PHPLocTask)
  +Task definition: phpmd (phing.tasks.ext.phpmd.PHPMDTask)
  +Task definition: phpdepend (phing.tasks.ext.pdepend.PhpDependTask)
  +Task definition: ftpdeploy (phing.tasks.ext.FtpDeployTask)
  +Task definition: phkpackage (phing.tasks.ext.phk.PhkPackageTask)
  +Task definition: pharpackage (phing.tasks.ext.phar.PharPackageTask)
  +Task definition: scp (phing.tasks.ext.ssh.ScpTask)
  +Task definition: scpsend (phing.tasks.ext.ssh.ScpTask)
  +Task definition: ssh (phing.tasks.ext.ssh.SshTask)
  +Task definition: replaceregexp (phing.tasks.ext.ReplaceRegexpTask)
  +Task definition: jsmin (phing.tasks.ext.jsmin.JsMinTask)
  +Task definition: version (phing.tasks.ext.VersionTask)
  +Task definition: filehash (phing.tasks.ext.FileHashTask)
  +Task definition: filesize (phing.tasks.ext.FileSizeTask)
  +Task definition: filesync (phing.tasks.ext.FileSyncTask)
  +Task definition: xmlproperty (phing.tasks.ext.XmlPropertyTask)
  +Task definition: exportproperties (phing.tasks.ext.ExportPropertiesTask)
  +Task definition: http-request (phing.tasks.ext.HttpRequestTask)
  +Task definition: httpget (phing.tasks.ext.HttpGetTask)
  +Task definition: patch (phing.tasks.ext.PatchTask)
  +Task definition: dbdeploy (phing.tasks.ext.dbdeploy.DbDeployTask)
  +Task definition: symlink (phing.tasks.ext.SymlinkTask)
  +Task definition: s3get (phing.tasks.ext.Service.Amazon.S3.S3GetTask)
  +Task definition: s3put (phing.tasks.ext.Service.Amazon.S3.S3PutTask)
  +Task definition: zendguardencode (phing.tasks.ext.zendguard.ZendGuardEncodeTask)
  +Task definition: zendguardlicense (phing.tasks.ext.zendguard.ZendGuardLicenseTask)
  +Task definition: phpdoc (phing.tasks.ext.phpdoc.PhpDocumentor2Task)
  +Task definition: phpdoc2 (phing.tasks.ext.phpdoc.PhpDocumentor2Task)
  +Task definition: inifile (phing.tasks.ext.inifile.IniFileTask)
  +Task definition: rST (phing.tasks.ext.rSTTask)
  +Task definition: sass (phing.tasks.ext.SassTask)
  +Task definition: apigen (phing.tasks.ext.apigen.ApiGenTask)
  +Task definition: parallel (phing.tasks.ext.ParallelTask)
  +Task definition: symfonyconsole (phing.tasks.ext.SymfonyConsole.SymfonyConsoleTask)
  +Task definition: composer (phing.tasks.ext.ComposerTask)
  +Task definition: autoloader (phing.tasks.ext.AutoloaderTask)
  +Task definition: liquibase-changelog (phing.tasks.ext.liquibase.LiquibaseChangeLogTask)
  +Task definition: liquibase-dbdoc (phing.tasks.ext.liquibase.LiquibaseDbDocTask)
  +Task definition: liquibase-diff (phing.tasks.ext.liquibase.LiquibaseDiffTask)
  +Task definition: liquibase-rollback (phing.tasks.ext.liquibase.LiquibaseRollbackTask)
  +Task definition: liquibase-tag (phing.tasks.ext.liquibase.LiquibaseTagTask)
  +Task definition: liquibase-update (phing.tasks.ext.liquibase.LiquibaseUpdateTask)
  +Task definition: liquibase (phing.tasks.ext.liquibase.LiquibaseTask)
  +Task definition: notifysend (phing.tasks.ext.NotifySendTask)
  +Task definition: growlnotify (phing.tasks.ext.GrowlNotifyTask)
  +Task definition: wikipublish (phing.tasks.ext.WikiPublishTask)
  +Task definition: stopwatch (phing.tasks.ext.StopwatchTask)
  +Task definition: throw (phing.tasks.ext.ThrowTask)
  +Task definition: pathtofileset (phing.tasks.ext.property.PathToFileSet)
  +Task definition: propertycopy (phing.tasks.ext.property.PropertyCopy)
  +Task definition: propertyregex (phing.tasks.ext.property.RegexTask)
  +Task definition: propertyselector (phing.tasks.ext.property.PropertySelector)
  +Task definition: var (phing.tasks.ext.property.Variable)
  +Task definition: sortlist (phing.tasks.ext.property.SortList)
  +Task definition: zsdtvalidate (phing.tasks.ext.zendserverdeploymenttool.zsdtValidateTask)
  +Task definition: zsdtpack (phing.tasks.ext.zendserverdeploymenttool.zsdtPackTask)
  +Task definition: phardata (phing.tasks.ext.phar.PharDataTask)
  +Task definition: sonar (phing.tasks.ext.sonar.SonarTask)
  +Task definition: hipchat (phing.tasks.ext.hipchat.HipchatTask)
  +Task definition: jsonvalidate (phing.tasks.ext.JsonValidateTask)
  +User datatype: commandline (phing.types.Commandline)
  +User datatype: fileset (phing.types.FileSet)
  +User datatype: dirset (phing.types.DirSet)
  +User datatype: filelist (phing.types.FileList)
  +User datatype: patternset (phing.types.PatternSet)
  +User datatype: mapper (phing.types.Mapper)
  +User datatype: filterchain (phing.types.FilterChain)
  +User datatype: filterreader (phing.types.PhingFilterReader)
  +User datatype: regexp (phing.types.RegularExpression)
  +User datatype: param (phing.types.Parameter)
  +User datatype: path (phing.types.Path)
  +User datatype: pearpackagefileset (phing.types.PearPackageFileSet)
  +User datatype: selector (phing.types.selectors.SelectSelector)
  +User datatype: sshconfig (phing.tasks.ext.ssh.Ssh2MethodParam)
  +User datatype: description (phing.types.Description)
  +User datatype: zipfileset (phing.tasks.ext.ZipFileSet)
Setting ro project property: phing.version -> Phing 3.0.0-alpha1
Adding reference: phing.version -> PropertyValue
Setting ro project property: phpbin -> C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
Adding reference: phpbin -> PropertyValue
Setting ro project property: phing.file -> C:\myproject\SmartCore\build.xml
Overriding previous definition of reference to phing.file
Adding reference: phing.file -> PropertyValue
Adding reference: phing.parsing.context -> PhingXMLContext
parsing buildfile build.xml
Setting ro project property: phing.file.smart -> C:\myproject\SmartCore\build.xml
Adding reference: phing.file.smart -> PropertyValue
Setting ro project property: phing.dir.smart -> C:\myproject\SmartCore
Adding reference: phing.dir.smart -> PropertyValue
Setting ro project property: phing.project.name -> SMART
Adding reference: phing.project.name -> PropertyValue
Adding reference: SMART -> Project
Adding reference: project.basedir -> PropertyValue
Project base dir set to: C:\myproject\SmartCore
  +Target:
  +Target: infection
  +Target: ?
  +Task: property
    -calling setter PropertyTask::setName()
    -calling setter PropertyTask::setValue()
Setting project property: xPHP_HOME -> C:\Development\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
Adding reference: xPHP_HOME -> PropertyValue
  +Task: property
    -calling setter PropertyTask::setName()
Property ${phpbin} => C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
    -calling setter PropertyTask::setValue()
Setting project property: PHP_HOME -> C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
Adding reference: PHP_HOME -> PropertyValue
Setting project property: phing.project.strictmode ->
Adding reference: phing.project.strictmode -> PropertyValue
Build sequence for target 'infection' is: infection
Complete build sequence is: infection  ?

SMART > infection:

  +Task: echo
    -calling setter EchoTask::setLevel()
Property ${PHP_HOME} => C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
    -calling setter EchoTask::setMsg()
     [echo] C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
  +Task: echo
    -calling setter EchoTask::setLevel()
    -calling setter EchoTask::setMsg()
     [echo] remove infection
  +Task: delete
    -calling setter DeleteTask::setDir()
    -calling setter DeleteTask::setIncludeEmptyDirs()
   [delete] Directory C:\myproject\SmartCore\infection does not exist or is not a directory.
  +Task: echo
    -calling setter EchoTask::setLevel()
    -calling setter EchoTask::setMsg()
     [echo] infection
  +Task: echo
Property ${PHP_HOME} => C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
     [echo] C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
  +Task: echo
    -calling setter EchoTask::setLevel()
Property ${PHP_HOME} => C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
    -calling setter EchoTask::setMsg()
     [echo] phphome is [C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe] between brackets
  +Task: exec
Property ${PHP_HOME} => C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
    -calling setter ExecTask::setExecutable()
    -calling setter ExecTask::setPassthru()
    -calling setter ExecTask::setEscape()
    -calling creator ExecTask::createArg()
    -calling setter CommandlineArgument::setValue()
    -calling creator ExecTask::createArg()
    -calling setter CommandlineArgument::setValue()
    -calling creator ExecTask::createArg()
    -calling setter CommandlineArgument::setValue()
     [exec] Current OS is WINNT
     [exec] Executing command: C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe ./vendor/infection/infection/bin/infection -j5 --ansi
You are running Infection with xdebug enabled.
    ____      ____          __  _
   /  _/___  / __/__  _____/ /_(_)___  ____
   / // __ \/ /_/ _ \/ ___/ __/ / __ \/ __ \
 _/ // / / / __/  __/ /__/ /_/ / /_/ / / / /
/___/_/ /_/_/  \___/\___/\__/_/\____/_/ /_/

Running initial test suite...

PHPUnit version: unknown

    6 [============================]  1 secProcessing source code files:  0/60

Generate mutants...


In CoverageDoesNotExistException.php line 22:

  Code Coverage does not exist. File C:\myproject\SmartCore/./infection/temp/infection/coverage-xml/index.xml is not found. Che
  ck phpunit version Infection was run with and generated config files inside C:\myproject\SmartCore/./infection/temp/infection
  . Make sure to either:
  - Enable xdebug and run infection again
  - Use phpdbg: phpdbg -qrr infection
  - Use --coverage option with path to the existing coverage report
  - Use --initial-tests-php-options option with `-d zend_extension=xdebug.so` and/or any extra php parameters


run [--test-framework TEST-FRAMEWORK] [--test-framework-options TEST-FRAMEWORK-OPTIONS] [-j|--threads THREADS] [--only-covered] [-s|--show-mutations] [-c|--configuration CONFIGURATION] [--coverage COVERAGE] [--mutators MUTATORS] [--filter FILTER] [--formatter FORMATTER] [--min-msi MIN-MSI] [--min-covered-msi MIN-COVERED-MSI] [--log-verbosity LOG-VERBOSITY] [--initial-tests-php-options INITIAL-TESTS-PHP-OPTIONS] [--ignore-msi-with-no-mutations] [--debug]


BUILD FINISHED

Total time: 4.2009 seconds


PS C:\myproject\SmartCore>

@siad007
Copy link
Member Author

siad007 commented Jan 2, 2019

When the command

[exec] Executing command: C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe ./vendor/infection/infection/bin/infection -j5 --ansi

succeedes without phing than I guess there might be a folder permissions problem on windows. I will try to reproduce this behavior. In the meantime you can try using the attrib task for windows tweaking your permissions. See https://www.phing.info/phing/guide/en/output/hlhtml/#AttribTask

@siad007
Copy link
Member Author

siad007 commented Jan 2, 2019

@marcelloh I added infection to one of my projects, made a fresh build.xml file and everything is working as expected:

build.xml

<?xml version="1.0"?>

<project name="Phing Build Tests" default="infection" basedir=".">
    <target name="infection">
        <exec executable="vendor/bin/infection" passthru="true">
            <arg value="-j5"/>
            <arg value="--ansi"/>
        </exec>
    </target>
</project>

Output:

C:\Users\xxx\AppData\Roaming\Composer\vendor\bin\phing.bat -f C:/Users/xxx/GITRepos/Assumptions/build.xml infection
Buildfile: C:\Users\xxx\GITRepos\Assumptions\build.xml

Phing Build Tests > infection:

You are running Infection with xdebug enabled.
     ____      ____          __  _
    /  _/___  / __/__  _____/ /_(_)___  ____
    / // __ \/ /_/ _ \/ ___/ __/ / __ \/ __ \
  _/ // / / / __/  __/ /__/ /_/ / /_/ / / / /
 /___/_/ /_/_/  \___/\___/\__/_/\____/_/ /_/

    0 [>---------------------------] < 1 secRunning initial test suite...

PHPUnit version: 7.5.1

    4 [============================] 3 secsProcessing source code files: 0/8

Generate mutants...

Processing source code files: 8/8
Creating mutated files and processes: 50/50
.: killed, M: escaped, S: uncovered, E: fatal error, T: timed out

.....M.....MM.MMMMMMM..MM.MMM..M..MM......M...M...   (50 / 50)

50 mutations were generated:
      30 mutants were killed
       0 mutants were not covered by tests
      20 covered mutants were not detected
       0 errors were encountered
       0 time outs were encountered

Metrics:
         Mutation Score Indicator (MSI): 60%
         Mutation Code Coverage: 100%
         Covered Code MSI: 60%

Please note that some mutants will inevitably be harmless (i.e. false positives).

Time: 39s. Memory: 12.00MB

BUILD FINISHED

Total time: 42.5029 seconds



Build finished at 02.01.2019 20:28 with exit code 0.

@siad007 siad007 changed the title Add inflection task Add infection task Jan 2, 2019
@siad007
Copy link
Member Author

siad007 commented Jan 2, 2019

You could try additional verbosity:

        <exec executable="vendor/bin/infection" passthru="true">
            <arg value="-j5"/>
            <arg value="--ansi"/>
            <arg value="-vvv"/>
        </exec>

@marcelloh
Copy link

done the -vvv

In CoverageDoesNotExistException.php line 22:

  [Infection\TestFramework\Coverage\CoverageDoesNotExistException]
  Code Coverage does not exist. File C:\Data\git\Smart\SmartCore/./infection/temp/infection/coverage-xml/index.xml is not found. Che ck phpunit version Infection was run with and generated config files inside C:\Data\git\Smart\SmartCore/./infection/temp/infection

The attrrib task is vague, because:

<attrib readonly="false">
    <fileset dir="${meta.inf}" includes="**/*.xml"/>
</attrib>

makes all ".xml" files below ${meta.inf} readable ???
which seems misinformation. But how to make them writable?
(anyway, I delete the infection directory upfront, so everything infection is generating, must be the way it wants them to be, I suppose.

@marcelloh
Copy link

marcelloh commented Jan 3, 2019

btw: I noticed you do:

<exec executable="vendor/bin/infection" passthru="true">

but when I do that, I'll get:

 [delete] Deleting directory C:\Data\git\Smart\SmartCore\infection
     [echo] infection
     [echo] C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe
     [echo] phphome is [C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe] between brackets

dir=$(d=${0%[/\\]*}; cd "$d"; cd "../infection/infection/bin" && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
        # Cygwin paths start with /cygdrive/ which will break windows PHP,
        # so we need to translate the dir path to windows format. However
        # we could be using cygwin PHP which does not require this, so we
        # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
        if [[ $(which php) == /cygdrive/* ]]; then
                dir=$(cygpath -m "$dir");
        fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/infection" "$@"

BUILD FINISHED

This is because I don't have php in my path (want to switch versions during development easily)

@marcelloh
Copy link

I also tried (a slightly modified version),

<?xml version="1.0"?>

<project name="Phing Build Tests" default="infection" basedir=".">
	<property name="PHP_HOME" value="${phpbin}" />

    <target name="infection">
		<exec executable="${PHP_HOME}" passthru="true" escape="false">
			<arg value="./vendor/infection/infection/bin/infection" />
            <arg value="-j5"/>
            <arg value="--ansi"/>
        </exec>
    </target>
</project>

which still gives me:

Buildfile: C:\Data\git\Smart\SmartCore\build.xml

Phing Build Tests > infection:

You are running Infection with xdebug enabled.
    ____      ____          __  _
   /  _/___  / __/__  _____/ /_(_)___  ____
   / // __ \/ /_/ _ \/ ___/ __/ / __ \/ __ \
 _/ // / / / __/  __/ /__/ /_/ / /_/ / / / /
/___/_/ /_/_/  \___/\___/\__/_/\____/_/ /_/

    0 [>---------------------------] < 1 secRunning initial test suite...

PHPUnit version: unknown

    6 [============================]  1 secProcessing source code files:  0/60

Generate mutants...


In CoverageDoesNotExistException.php line 22:

  Code Coverage does not exist. File C:\Data\git\Smart\SmartCore/./infection/temp/infection/coverage-xml/index.xml is not found. Che
  ck phpunit version Infection was run with and generated config files inside C:\Data\git\Smart\SmartCore/./infection/temp/infection
  . Make sure to either:
  - Enable xdebug and run infection again
  - Use phpdbg: phpdbg -qrr infection
  - Use --coverage option with path to the existing coverage report
  - Use --initial-tests-php-options option with `-d zend_extension=xdebug.so` and/or any extra php parameters


run [--test-framework TEST-FRAMEWORK] [--test-framework-options TEST-FRAMEWORK-OPTIONS] [-j|--threads THREADS] [--only-covered] [-s|--show-mutations] [-c|--configuration CONFIGURATION] [--coverage COVERAGE] [--mutators MUTATORS] [--filter FILTER] [--formatter FORMATTER] [--min-msi MIN-MSI] [--min-covered-msi MIN-COVERED-MSI] [--log-verbosity LOG-VERBOSITY] [--initial-tests-php-options INITIAL-TESTS-PHP-OPTIONS] [--ignore-msi-with-no-mutations] [--debug]


BUILD FINISHED

Total time: 3.0142 seconds

@marcelloh
Copy link

marcelloh commented Jan 3, 2019

I also tried to debug infection, but somehow it ens at the passthru command, when the debug session it not passed on to.
This is the command:

C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe -n -c C:\Users\Marcelloh\AppData\Local\Temp\AD0.tmp ./vendor/infection/infection/bin/infection -j5 --ansi -vvv

My command would be:

C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php.exe -d xdebug.remote_enable=1 -d xdebug.remote_autostart=On -d xdebug.idekey=Intellij ./vendor/infection/infection/bin/infection -j5 --ansi -vvv

So I changed the passthry command to be a working one, to be able to debug more.
I come all the way to:
InfectionCommand->execute
where it does this:
$codeCoverageData = $this->getCodeCoverageData($testFrameworkKey);
The location it has for the coverageDir:
"C:\Data\git\Smart\SmartCore/./infection/temp/infection/coverage-xml"
but there is no such file there.
So it must be generated along the way, but somehow skipped in my configuration.
Where does it generate that xml?

@siad007
Copy link
Member Author

siad007 commented Jan 3, 2019

@marcelloh this file is generated by infection and the infection command generation and execution is done by phing.

@marcelloh
Copy link

obviously, this file is not generated by infection, because it is complaining about it.
(See my previous messages about it.) But the thing is, it IS generating it, when I do it normally via the commandline, so it must be something that is different.

@siad007
Copy link
Member Author

siad007 commented Jan 3, 2019

It is generated by the test framework you use inside infection. As you can see on my example it is working just fine with phing. Maybe you should use phing as a command or as a composer dependency instead of require_once it.

@siad007
Copy link
Member Author

siad007 commented Jan 3, 2019

But without a reproducable example, I am not able to give you more info.

@marcelloh
Copy link

when I do it via a separate batch file (start_phing) which has the following command:

C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php  ./vendor/phing/phing/bin/phing infection -j5 --ansi -vvv

And it still gives me that infection can't find :
./infection/temp/infection/coverage-xml/index.xml is not found.

when I do the same without phin, but call infection via a batch file:

C:\Development\Laragon_lite\bin\php\php-7.2.12-nts-Win32-VC15-x64\php  -d xdebug.remote_enable=1 -d xdebug.remote_autostart=On -d xdebug.idekey=Intellij ./vendor/infection/infection/bin/infection -j5 --ansi -vvv

it works (I think because it gets all the debugging extra's with it.)

@marcelloh
Copy link

But without a reproducable example, I am not able to give you more info.
The thing is, that I don't have a php available at my command line. (choose to have it like that), and your example does assume it has. Can you try when you do it more like my example, executing bphp and giving it the arg's to start?

<exec executable="${PHP_HOME}" passthru="true" escape="false">
            <arg value="./vendor/infection/infection/bin/infection" />
            <arg value="-j5"/>
            <arg value="--ansi"/>
</exec>

@siad007
Copy link
Member Author

siad007 commented Jan 3, 2019

Both versions (with and without php as a executable) works for me.

@marcelloh
Copy link

php 7.2.12? (I really don't get this), which is an unfortanatelty event, and I really appreiciate your time.. grrr.
Shall I close it, and hope in time it will be somehow fixed? It cost us both too much time, I think.

@siad007
Copy link
Member Author

siad007 commented Jan 3, 2019

As a last try: could you try phing dev-master instead of 3.0.0-alpha? Maybe an issue which was solved already?

@siad007
Copy link
Member Author

siad007 commented Jan 3, 2019

You do not need to close as I am working on a single task for infection.

@siad007 siad007 self-assigned this Jan 3, 2019
@marcelloh
Copy link

Ok, fine to hear that and, if you need a tester :-) ....

@siad007
Copy link
Member Author

siad007 commented Jan 4, 2019

@marcelloh would you mind update your phing to the new alpha release - i discovered a bugfix, which fixed an issue of argument escaping under windows. See #735
This could resolve your issue with the exec task.

@marcelloh
Copy link

I had a long weekend so sorry for the delay. I have the alpha 2 now, but with the same result:

In CoverageDoesNotExistException.php line 22

@stale
Copy link

stale bot commented Jul 6, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 6, 2019
@siad007 siad007 removed the wontfix label Jul 7, 2019
@mimmi20
Copy link
Contributor

mimmi20 commented Oct 20, 2019

@siad007 Are you still working on this?

@siad007
Copy link
Member Author

siad007 commented Oct 20, 2019

@mimmi20 i had a lot of work here but was stopped by could not catch a status from the infection command as far as i remember. if you are interested in taking over i will commit my changes.

@siad007 siad007 removed their assignment Oct 20, 2019
@siad007
Copy link
Member Author

siad007 commented Nov 9, 2019

Related to #654

@stale
Copy link

stale bot commented May 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 7, 2020
@siad007 siad007 removed the wontfix label May 17, 2020
@mrook
Copy link
Member

mrook commented Dec 23, 2020

@mimmi20 are you still interested in picking this up?

@mimmi20
Copy link
Contributor

mimmi20 commented Dec 23, 2020

Sorry, no

@mrook
Copy link
Member

mrook commented Dec 24, 2020

Okay, thanks! In that case we'll close this issue for now. If/when someone has time to contribute a task, we can re-open.

@mrook mrook closed this as completed Dec 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants