Jenkins running xcode unit tests not working - xcode

I'm trying to configure CI with Jenkins for Xcode. I'm getting the following error in the console. The tests are running and I get a test output with JUnit. However it still says that it cannot runscripts.
Test Suite 'All tests' started at 2013-05-29 23:44:13 +0000
Test Suite '/Users/originate/.jenkins/jobs/Test/workspace/build/Debug-iphonesimulator/HelloWorldTests.octest(Tests)' started at 2013-05-29 23:44:13 +0000
Test Suite 'HelloWorldTests' started at 2013-05-29 23:44:13 +0000
Test Case '-[HelloWorldTests testExample]' started.
Test Case '-[HelloWorldTests testExample]' passed (0.000 seconds).
Test Suite 'HelloWorldTests' finished at 2013-05-29 23:44:13 +0000.
Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite '/Users/originate/.jenkins/jobs/Test/workspace/build/Debug-iphonesimulator/HelloWorldTests.octest(Tests)' finished at 2013-05-29 23:44:13 +0000.
Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'All tests' finished at 2013-05-29 23:44:13 +0000.
Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
Command /bin/sh failed with exit code 1
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution "Run Script" build/HelloWorld.build/Debug-iphonesimulator/HelloWorldTests.build/Script-09E70126174EF7C800DFCE82.sh
(1 failure)
Build step 'Xcode' marked build as failure
Recording test results
Build step 'Upload to Testflight' marked build as failure
Finished: FAILURE
EDIT
The following error is given from running unit tests on command line in addition to the above error:
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x7fb9d35003a0 {NSLocalizedDescription=Simulator session timed out.}
The script for the unit tests that I am running is:
#!/usr/bin/env ruby
if ENV['SL_RUN_UNIT_TESTS'] then
launcher_path = "ios-sim"
test_bundle_path= File.join(ENV['BUILT_PRODUCTS_DIR'], "#{ENV['PRODUCT_NAME']}.#{ENV['WRAPPER_EXTENSION']}")
environment = {
'DYLD_INSERT_LIBRARIES' => "/../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection",
'XCInjectBundle' => test_bundle_path,
'XCInjectBundleInto' => ENV["TEST_HOST"]
}
environment_args = environment.collect { |key, value| "--setenv #{key}=\"#{value}\""}.join(" ")
app_test_host = File.dirname(ENV["TEST_HOST"])
passed = system("#{launcher_path} launch \"#{app_test_host}\" #{environment_args} --args -SenTest All #{test_bundle_path}")
exit(1) if !passed
exit 0
else
puts "SL_RUN_UNIT_TESTS not set - Did not run unit tests!"
exit 0
end
Please help me out.
Thanks!

Related

PIPE Connection to jenkins timing out

Any help sooner would be greatly appreciated
I am using PIPE to connect to Jenkins pipeline from BB and using the below code in my BB.yml
- step: &functionalTest
name: functional test
image: python:3.9
script:
- pipe: atlassian/jenkins-job-trigger:0.1.1
variables:
JENKINS_URL: '<<myJenkinsURL>>'
JENKINS_USER: '<<myJenkinsUser>>'
JENKINS_TOKEN: $JENKINS_USER_TOKEN
JOB_NAME: '<<myJenkinsJob>>'
WAIT: 'true'
WAIT_MAX_TIMEOUT: 500
It was working fine until last week. However, since Friday I can see number failures in BB pipeline with the timeout. Though the Jenkins job is successful and took only 4 mins and 56 secs to execute all test cases. Also I have WAIT_MAX_TIMEOUT: 500 (almost 8 mins max timeout)
Exception:
✖ Timeout while waiting for jenkins job with build number 254 to be completed
PS: Jenkins job for this build ID is successful in 5 mins (including the Sonar report generation)

Jenkins - jmeter performance plugin - Build step 'Publish Performance test result report' changed build result to FAILURE Finished: FAILURE

I m trying to generate performance report through jenkins peformance plug-in, when ever i try to perform build now. i get the error
- Started by user Mukesh kumar
Building in workspace C:\Program Files (x86)\Jenkins\workspace\Aug17- Jmeter test
[Aug17- Jmeter test] $ cmd /c call C:\windows\TEMP\jenkins2034852437917248179.bat
C:\Program Files (x86)\Jenkins\workspace\Aug17- Jmeter test>C:\Users\ux010725\Downloads\Softwares\Jmeter\apache-jmeter-4.0\bin\jmeter.bat -Jjmeter.save.saveservice.output_format=xml -n -t C:\Users\ux010725\Downloads\Softwares\Jmeter\apache-jmeter-4.0\TestPlan_Aug14.jmx -l Mukesh_Reports\r2.xml
Creating summariser <summary>
Created the tree successfully using C:\Users\ux010725\Downloads\Softwares\Jmeter\apache-jmeter-4.0\TestPlan_Aug14.jmx
Starting the test # Fri Aug 17 15:48:37 IST 2018 (1534501117309)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary = 42 in 00:00:09 = 4.6/s Avg: 208 Min: 113 Max: 2358 Err: 0 (0.00%)
Tidying up ... # Fri Aug 17 15:48:47 IST 2018 (1534501127021)
... end of run
Cannot detect file type because of error: Failed to copy C:\Users\ux010725\Downloads\Softwares\Jmeter\apache-jmeter-4.0\bin\Mukesh_Reports\r2.xml to C:\Program Files (x86)\Jenkins\jobs\Aug17- Jmeter test\builds\17\temp\r2.xml
Build step 'Publish Performance test result report' changed build result to FAILURE
Finished: FAILURE
Try removing spaces in « Aug17- jmeter test »
This might explain the failure

Is there logging statements available for rake test in test-unit using ruby

I am running rake test in ruby.
When I run rake test, I get the following output
rake TEST=test_cases/test.rb
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p247/bin/ruby -I"helpers" -I"/home/ubuntu/.rvm/gems/ruby-2.0.0-p247#test/gems/rake-10.1.0/lib" "/home/karunakaran/.rvm/gems/ruby-2.0.0-p247#test/gems/rake-10.1.0/lib/rake/rake_test_loader.rb" "test_cases/test.rb"
Loaded suite /home/ubuntu/.rvm/gems/ruby-2.0.0-p247#test/gems/rake-10.1.0/lib/rake/rake_test_loader
Started
.
Finished in 64.385604437 seconds.
1 tests, 16 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
0.02 tests/s, 3.35 assertions/s
I want to get test suite logging at-least minimally instead just showing dot(.) for each test
Test logging like as below or any logging at step by step manner
Testname started
Running testname..
Error will display if we get any error
Testname completed

Xcodebuild: [MT] IDETestOperationsObserverDebug

I try to run my test on a iphonesimulator with Xcodebuild but I get always the same errors.
My command line:
xcodebuild clean test -workspace App.xcworkspace -scheme "UI Tests" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.2'
The stacktrace:
xcodebuild[31826:741511] [MT] IDETestOperationsObserverDebug: (796137A0-CB6A-490D-BF89-767DF586BE26) Beginning test session 796137A0-CB6A-490D-BF89-767DF586BE26 with Xcode 7C68 on target <DVTiPhoneSimulator: 0x7fef34dce060> {
SimDevice: SimDevice : iPhone 6 (ED6BBC90-CCD7-4AFE-ABBD-AFAE28B7EEC7) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPhone-6 } runtime={ SimRuntime : 9.2 (13C75) - com.apple.CoreSimulator.SimRuntime.iOS-9-2 }
} (9.2 (13C75))
2016-02-22 13:07:10.489 XCTRunner[32908:746212] Running tests...
2016-02-22 13:07:10.490 XCTRunner[32908:746212] Looking for test bundles in /Users/me/Library/Developer/CoreSimulator/Devices/ED6BBC90-CCD7-4AFE-ABBD-AFAE28B7EEC7/data/Containers/Bundle/Application/2D77EC0A-85FA-4C8B-BC62-27334E6278C5/UITests-Runner.app/PlugIns
2016-02-22 13:07:10.491 XCTRunner[32908:746212] Found test bundle at /Users/me/Library/Developer/CoreSimulator/Devices/ED6BBC90-CCD7-4AFE-ABBD-AFAE28B7EEC7/data/Containers/Bundle/Application/2D77EC0A-85FA-4C8B-BC62-27334E6278C5/UITests-Runner.app/PlugIns/UITests.xctest
2016-02-22 13:07:10.492 XCTRunner[32908:746212] Looking for configurations in /Users/me/Library/Developer/CoreSimulator/Devices/ED6BBC90-CCD7-4AFE-ABBD-AFAE28B7EEC7/data/Containers/Bundle/Application/2D77EC0A-85FA-4C8B-BC62-27334E6278C5/UITests-Runner.app/PlugIns/UITests.xctest
2016-02-22 13:07:10.494 XCTRunner[32908:746212] Found configuration <XCTestConfiguration: 0x7fd750623340>
testBundleURL:file:///Users/me/Library/Developer/Xcode/DerivedData/App-axxxxxxxxxxx/Build/Products/Debug-iphonesimulator/UITests-Runner.app/PlugIns/UITests.xctest/
productModuleName:UITests
testsToSkip:UITests/test_App()
testsToRun:(null)
reportResultsToIDE:YES
sessionIdentifier:<__NSConcreteUUID 0x7fd750626d10> 796137A0-CB6A-490D-BF89-767DF586BE26
pathToXcodeReportingSocket:(null)
disablePerformanceMetrics:no
treatMissingBaselinesAsFailures:no
baselineFileURL:(null)
targetApplicationPath:/Users/me/Library/Developer/Xcode/DerivedData/App-axxxxxxxxxxxxxx/Build/Products/Debug-iphonesimulator/App.app
targetApplicationBundleID:de.xxxxx
reportActivities:YES
testsMustRunOnMainThread:YES
13:07:10.629 XCTRunner[32908:746223] _XCT_testBundleReadyWithProtocolVersion:minimumVersion: reply received
13:07:10.635 XCTRunner[32908:746221] _IDE_startExecutingTestPlanWithProtocolVersion:16
2016-02-22 13:07:10.992 XCTRunner[32908:746212] Continuing to run tests in the background with task ID 1
Test Suite 'Selected tests' started at 2016-02-22 13:07:11.557
Test Suite 'UITests.xctest' started at 2016-02-22 13:07:11.558
Test Suite 'UITests.xctest' passed at 2016-02-22 13:07:11.558.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
** TEST FAILED **
When I call the test direct on Xcode, I have any problems.
Any ideas?
Thank for helping.
Cheers.

Rails 3 "rake test" command output

running "rake test" with a simple Rails 3 project gives me the following output.
Why are two suites listed? I have one default test with "assert true" which is counted in the first suite but not the second.
Any ideas? I know Ruby 1.9 replaced Test::Unit with MiniTest which has caused some issues, but after a few hours Googling I haven't found an explanation for this output.
NOTICE: CREATE TABLE (etc.)
Loaded suite /Users/me/.rvm/gems/ruby-1.9.2-head#rails/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
.
Finished in 0.030670 seconds.
1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
Test run options: --seed 14141
Loaded suite /Users/me/.rvm/gems/ruby-1.9.2-head#rails/bin/rake
Started
Finished in 0.003156 seconds.
0 tests, 0 assertions, 0 failures, 0 errors, 0 skips
Test run options: --seed 56342

Resources