We have more issues while running sample test in MTAF.
I have completed all the basic installation setup as per the MTAF documentation.
When i try to run the sample test, below issues are found in Netbeans.
1) Firefox is not running, When in try to run the test in Netbeans 6.9.1.
phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true"
backupStaticAttributes="false"
bootstrap="bootstrap.php"
cacheTokens="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
mapTestClassNameToCoveredClassName="false"
printerClass="PHPUnit_TextUI_ResultPrinter"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
strict="false"
verbose="true">
<testsuites>
<testsuite name="All Tests">
<directory suffix="Test.php">testsuite/Core/Mage</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="./tmp/report" charset="UTF-8" yui="true" highlight="false"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-xml" target="./tmp/coverage.xml"/>
<log type="graphviz" target="./tmp/logfile.dot"/>
<log type="json" target="./tmp/logfile.json"/>
<log type="metrics-xml" target="./tmp/metrics.xml"/>
<log type="plain" target="./tmp/logfile.txt"/>
<log type="pmd-xml" target="./tmp/pmd.xml" cpdMinLines="5" cpdMinMatches="70"/>
<log type="tap" target="./tmp/logfile.tap" logIncompleteSkipped="true"/>
<log type="junit" target="./tmp/logfile.xml" logIncompleteSkipped="false"/>
<log type="testdox-html" target="./tmp/testdox.html"/>
<log type="testdox-text" target="./tmp/testdox.txt"/>
</logging>
</phpunit>
config.yml
browsers:
googlechrome: &googlechrome
name: 'Google Chrome'
browser: '*googlechrome'
host: 'localhost'
port: 4444
timeout: 60
firefox: &firefox
name: 'Firefox'
browser: '*chrome'
host: 'localhost'
port: 4444
timeout: 60
iexplorer: &iexplorer
name: 'Internet Explorer'
browser: '*iexplore'
host: 'localhost'
port: 4444
timeout: 60
default: *firefox
framework:
fixture_base_path: 'fixture'
testsuite_base_path: 'testsuite'
#work only if tests are run for single browser
shareSession: true
coverageScriptUrl: ''
#captureScreenshotOnFailure works only for browsers that support it: Firefox/Chrome, IE with snapsIE tool
captureScreenshotOnFailure: true
saveHtmlPageOnFailure: false
load_all_uimaps: true
load_all_data: true
cache:
frontend:
name: 'core'
options:
caching: false
cache_id_prefix: 'selenium_'
automatic_serialization: true
backend:
name: 'file'
options:
cache_dir: 'var/cache'
applications:
mage: &mage
fallbackOrderFixture: 'default'
fallbackOrderHelper: 'Core'
areas:
admin:
url: 'http://www.localhost.com/magento/index.php/admin/'
base_page_uimap: 'log_in_to_admin'
uimap_path: 'admin'
login: 'admin'
password: 'admin123'
frontend:
url: 'http://www.localhost.com/magento/index.php'
base_page_uimap: 'home_page'
default: *mage
2) Shall i need to add / modify any other codes in my system?
3) When i try to click the test project under the Run, its seems error as like below screen shot.
Folder Structure :
I have used testing folder structure as like GITHUB.
But MTAF document gives the different folder structure like reference document.
I can see the different folder structure in GIT & reference link.
Which is correct folder structure to use in test frame work?
Any help my appreciation.
I used updated version NetBeans(NetBeans IDE 7.2.1).
I solved this issue.
The folder structure in the GIT works fine for MTAF. Just add the testcases in the testsuite under the required folder.
Related
I'm trying to add a condition before installing PostgreSQL on Wix bundle.
I'm expecting it to check if there is an installed version of PostgreSQL as you can see on my following code:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Title" Version="1.0.0.0" Manufacturer="Manufacture" UpgradeCode="5aee5af2-10c7-42d1-bde6-c7dadf736786">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
<?define InstallPgCommand=--unattendedmodeui minimal --mode unattended --superpassword "super_pwd" --servicename "service_name" --servicepassword "service_pwd" --serverport 5433?>
<Chain>
<!-- Install postgres -->
<ExePackage
SourceFile="ThirdPartyApps\postgresql-14.3-1-windows-x64.exe"
Compressed ="yes"
Vital ="yes"
Permanent ="yes"
InstallCommand="$(var.InstallPgCommand)"
InstallCondition="NOT POSTGRESINSTALLED"
/>
</Chain>
</Bundle>
<Fragment>
<Property Id="POSTGRESINSTALLED">
<RegistrySearch Id="POSTGRESINSTALLED_SEARCH" Key="SOFTWARE\PostgreSQL\Installations\postgresql-x64-14" Root="HKLM" Type="raw" Name="Branding" />
</Property>
</Fragment>
</Wix>
But it didn't work as expect.
Can you tell me what I'm doing wrong ? Thanks everyone
RegistrySearch is for MSI packages. For bundles, use util:RegistrySearch instead.
I am trying to add code coverage to a .NET Framework 4.8 solution in Azure DevOps. I have based my approach on the questions here and here and the coverlet docs, and am successfully getting code coverage results.
However this solution also contains a number of shared projects which have their unit tests in a different solution. I wish to exclude these projects, and the test projects themselves from the coverage report.
In my coverlet.runsettings file I have included the following lines based on the docs:
<Exclude>[coverlet.*.tests?]*,[*]Coverlet.Core*,[Company.*UnitTest]*</Exclude>
<Include>[Company.Application.*]*</Include>
However when the tests are run using the VSTest#2 I see the following in the logs
Provided settings file:
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Format>cobertura</Format>
<Exclude>[coverlet.*.tests?]*,[*]Coverlet.Core*,[Company.*UnitTests]*</Exclude>
<Include>[Company.Application.*]*</Include>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
Updated Run Settings:
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<!-- As above -->
</DataCollector>
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<!-- Lots of configuration ommitted for brevity -->
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
<RunConfiguration>
<MaxCpuCount>0</MaxCpuCount>
<BatchSize>1000</BatchSize>
<ResultsDirectory>D:\a\_temp\TestResults</ResultsDirectory>
</RunConfiguration>
</RunSettings>
**************** Starting test execution *********************
So it appears the VS test task is altering my runsettings on the fly and then not respecting the inclusions and exclusions values
My yaml is:
- task: VSTest#2
displayName: 'Run Tests'
inputs:
testAssemblyVer2: '**\*UnitTests*.dll'
searchFolder: '.\Output'
codeCoverageEnabled: true
runSettingsFile: .\Builds\coverlet.runsettings
Can anyone suggest a setting or some other way to respect the inclusions and exclusions?
It is counterintuitive, but in order to VS test task does not alter runsettings on the fly, need to remove "codeCoverageEnabled: true" and add "runSettingsFile: .\Builds\coverlet.runsettings":
- task: VSTest#2
displayName: 'Run Tests'
inputs:
testAssemblyVer2: '**\*UnitTests*.dll'
searchFolder: '.\Output'
runSettingsFile: .\Builds\coverlet.runsettings
Code coverage still will be calculated because of runsettings file.
In order to exclude something, you can check https://learn.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2022#sample-runsettings-file
I copy pasted here in case the link is broken
<!--
About include/exclude lists:
Empty "Include" clauses imply all; empty "Exclude" clauses imply none.
Each element in the list is a regular expression (ECMAScript syntax). See /visualstudio/ide/using-regular-expressions-in-visual-studio.
An item must first match at least one entry in the include list to be included.
Included items must then not match any entries in the exclude list to remain included.
-->
<!-- Match assembly file paths: -->
<ModulePaths>
<Include>
<ModulePath>.*\.dll$</ModulePath>
<ModulePath>.*\.exe$</ModulePath>
</Include>
<Exclude>
<ModulePath>.*CPPUnitTestFramework.*</ModulePath>
</Exclude>
</ModulePaths>
<!-- Match fully qualified names of functions: -->
<!-- (Use "\." to delimit namespaces in C# or Visual Basic, "::" in C++.) -->
<Functions>
<Exclude>
<Function>^Fabrikam\.UnitTest\..*</Function>
<Function>^std::.*</Function>
<Function>^ATL::.*</Function>
<Function>.*::__GetTestMethodInfo.*</Function>
<Function>^Microsoft::VisualStudio::CppCodeCoverageFramework::.*</Function>
<Function>^Microsoft::VisualStudio::CppUnitTestFramework::.*</Function>
</Exclude>
</Functions>
<!-- Match attributes on any code element: -->
<Attributes>
<Exclude>
<!-- Don't forget "Attribute" at the end of the name -->
<Attribute>^System\.Diagnostics\.DebuggerHiddenAttribute$</Attribute>
<Attribute>^System\.Diagnostics\.DebuggerNonUserCodeAttribute$</Attribute>
<Attribute>^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$</Attribute>
<Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute>
</Exclude>
</Attributes>
<!-- Match the path of the source files in which each method is defined: -->
<Sources>
<Exclude>
<Source>.*\\atlmfc\\.*</Source>
<Source>.*\\vctools\\.*</Source>
<Source>.*\\public\\sdk\\.*</Source>
<Source>.*\\microsoft sdks\\.*</Source>
<Source>.*\\vc\\include\\.*</Source>
</Exclude>
</Sources>
<!-- Match the company name property in the assembly: -->
<CompanyNames>
<Exclude>
<CompanyName>.*microsoft.*</CompanyName>
</Exclude>
</CompanyNames>
<!-- Match the public key token of a signed assembly: -->
<PublicKeyTokens>
<!-- Exclude Visual Studio extensions: -->
<Exclude>
<PublicKeyToken>^B77A5C561934E089$</PublicKeyToken>
<PublicKeyToken>^B03F5F7F11D50A3A$</PublicKeyToken>
<PublicKeyToken>^31BF3856AD364E35$</PublicKeyToken>
<PublicKeyToken>^89845DCD8080CC91$</PublicKeyToken>
<PublicKeyToken>^71E9BCE111E9429C$</PublicKeyToken>
<PublicKeyToken>^8F50407C4E9E73B6$</PublicKeyToken>
<PublicKeyToken>^E361AF139669C375$</PublicKeyToken>
</Exclude>
</PublicKeyTokens>
I'm trying to use an oni recording in my application using OpenNI. Here is my xml file:
<OpenNI>
<Licenses>
<!-- Add application-specific licenses here
<License vendor="vendor" key="key"/>
-->
</Licenses>
<Log writeToConsole="false" writeToFile="false">
<!-- 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default) -->
<LogLevel value="3"/>
<Masks>
<Mask name="ALL" on="true"/>
</Masks>
<Dumps>
</Dumps>
</Log>
<ProductionNodes>
<Recording file="Recording.oni" />
<!-- Set global mirror -->
<GlobalMirror on="true"/>
</ProductionNodes>
</OpenNI>
Everything looks ok, but when I try to run my program, I get:
Open failed: Function was not implemented!
What could be the problem?
The problem were the two following lines:
<!-- Set global mirror -->
<GlobalMirror on="true"/>
After removing them, my program works fine.
I’m trying to build a Deployment Package in Visual Web Developer Express 2010 which sets the ACL for a subfolder of the deployed website. I used the following information http://leethams.wordpress.com/2010/06/12/modifying-directory-permissions-with-web-deployment/
This is my test:
Create a new blank ASP.NET Application (WebApplication2 in this example)
In advanced compilation options, change .NET Framework target version to 3.5
Create a new folder (Config in this example) and add any file inside the folder
Create a new file called WebApplication2.wpp.targets, with this content
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Extends the AfterAddIisSettingAndFileContentsToSourceManifest action do also set ACLs -->
<IncludeCustomACLs>TRUE</IncludeCustomACLs>
<AfterAddIisSettingAndFileContentsToSourceManifest Condition="'$(AfterAddIisSettingAndFileContentsToSourceManifest)'==''">
$(AfterAddIisSettingAndFileContentsToSourceManifest);
SetCustomACLs;
</AfterAddIisSettingAndFileContentsToSourceManifest>
</PropertyGroup>
<Target Name="SetCustomACLs" Condition="'$(IncludeCustomACLs)'=='TRUE'">
<Message Text="Adding Custom ACls" />
<ItemGroup>
<MsDeploySourceManifest Include="setAcl" Condition="$(IncludeSetAclProviderOnDestination)">
<setAclUser>anonymousAuthenticationUser</setAclUser>
<path>$(_MSDeployDirPath_FullPath)</path>
<setAclAccess>Read,Write</setAclAccess>
<setAclResourceType>Directory</setAclResourceType>
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>
</ItemGroup>
</Target>
</Project>
I execute from the command line and everything works fine:
-------------------------------------------------------
Start executing msdeploy.exe
-------------------------------------------------------
"C:\Program Files\IIS\Microsoft Web Deploy\\msdeploy.exe" -source:package='C:\T
emp\WebApplication2\WebApplication2\obj\Debug\Package\WebApplication2.zip' -dest
:auto,includeAcls='False' -verb:sync -disableLink:AppPoolExtension -disableLink:
ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\Temp\WebApp
lication2\WebApplication2\obj\Debug\Package\WebApplication2.SetParameters.xml"
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Número total de cambios: 3 (0 agregados, 0 eliminados, 3 actualizados, 0 parámet
ros cambiados, 0 bytes copiados)
Now, to set the permissions for the Config folder, I change the following line and rebuild the deployment package.
<path>$(_MSDeployDirPath_FullPath)/Config</path>
I get the following error:
-------------------------------------------------------
Start executing msdeploy.exe
-------------------------------------------------------
"C:\Program Files\IIS\Microsoft Web Deploy\\msdeploy.exe" -source:package='C:\T
emp\WebApplication2\WebApplication2\obj\Debug\Package\WebApplication2.zip' -dest
:auto,includeAcls='False' -verb:sync -disableLink:AppPoolExtension -disableLink:
ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\Temp\WebApp
lication2\WebApplication2\obj\Debug\Package\WebApplication2.SetParameters.xml"
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (C:\Temp\WebApplication2\WebApplication2\obj\Debug\Pac
kage\PackageTmp/Config).
Error: Se debe especificar un valor para 'setAclUser' cuando se usa el proveedor
'setAcl' con una ruta de acceso física.
Recuento de errores: 1.
In English it says: “Error: a value for ‘setAclUser’ must be specified when using the ‘setAcl’ provider with a physical path". Notice the third setAcl was changed to the physical path where the deployment package is located.
I then tried to modify it this way:
<AdditionalProviderSettings>setAclUser;setAclResourceType;setAclAccess</AdditionalProviderSettings>
But the error remains.
If I execute the deployment package with the “/t” switch, it does not throw the error, although it still shows the physical path.
I can hardcode the IIS path and change the line like this:
<path>Default Web Site/WebApplication2_deploy/Config</path>
It works fine. However, I wouldn’t like to do that, since the installation path need to be parameterized.
Changing the path to a backslassh makes no difference:
<path>Default Web Site/WebApplication2_deploy\Config</path>
Any help would be appreciated.
Thanks
I have some issues with code coverage reports in PHPunit and the zend framework. Whenever I run a phpunit test the code coverage fails returning the following message:
PHPUnit 3.4.15 by Sebastian Bergmann.
I.......III.I................................IIIIIIIIIIIIIII 60 / 93
IIII....I....I..II..II.....IIIIII
Time: 4 seconds, Memory: 22.25Mb
OK, but incomplete or skipped tests!
Tests: 93, Assertions: 174, Incomplete: 36.
Generating code coverage report, this may take a moment.PHP Fatal error: Cannot redeclare class Klunde_Auth in /Users/kristianlunde/workspaces/private/klunde/Library/Klunde/Auth.php on line 9
Fatal error: Cannot redeclare class Klunde_Auth in /Users/kristianlunde/workspaces/private/klunde/Library/Klunde/Auth.php on line 9
My phpunit.xml file looks like this:
<phpunit bootstrap="./application/bootstrap.php" colors="true">
<testsuite name="Klunde">
<directory>./application/</directory>
<directory>./Library/Klunde</directory>
</testsuite>
<filter>
<whitelist>
<directory suffix=".php">../application</directory>
<directory suffix=".php">../Library/Klunde</directory>
<exclude>
<directory suffix=".phtml">../application/</directory>
<file>../application/Bootstrap.php</file>
<file>../application/controllers/ErrorController.php</file>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./log/report" charset="UTF-8" yui="true"
highlight="true" lowUpperBound="50" highLowerBound="80" />
<log type="testdox-html" target="./log/testdox.html" />
</logging>
</phpunit>
I did a
var_dump(get_included_files());
at the top of the Auth file and it did try to include the file more than once before it failed.
I have also tried to remove the Klunde_Auth.php file just to see if it was a one file issue, but then the error is triggered on the next file in the Library/Klunde directory.
I am running OSX Snow Leopard, with PHP 5.3.1, XDebug 2.1.0beta3 and PHPUnit 3.4.15
All help and assistance will be highly appreciated.
Thanks.
add a debug_print_backtrace() call to the top of your Klunde_Auth.php, before the class declaration itself starts.
Then run the testsuite again, now you will see the whole backtrace each time the file is included, this should help you to figure out what/from where it is being included twice.