Maven+TestNG testing through Jenkins on Ubuntu - maven

I have built a maven+testng testing framework project on eclipse. I installed Jenkins on my local host and ran my project in there till now without any problem. My OS is Windows 10. I also ran my project on different Windows OS machines without any problem.
However I wanted cross platform testing, so I tried running my project in an Ubuntu machine. I did all the setup processes. I configured Firefox binary path and also installed X server, i.e xvfb on that Ubuntu machine.
I did some changes in my webdriver java file
package com.mednet.webdriver;
import java.io.File;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
public class WebdriverSetUp {
public static WebDriver driver = null;
public static WebDriver startdriver() {
FirefoxBinary binary = new FirefoxBinary(new File("/opt/firefox/firefox"));
binary.setEnvironmentProperty("DISPLAY", System.getProperty("lmportal.xvfb.id", ":99"));
return driver = new FirefoxDriver(binary, null);
}
}
Then I used following commands in terminal of Ubuntu to install firefox and xvfb.
to install firefox: sudo apt-get install firefox
to install xvfb: sudo apt-get xvfb & export DISPLAY=:99 & xvfb 99 -ac
Here I used DISPLAY=:99
Now when I start to build in Jenkins.
Following is my console output
Results :
Failed tests: testInvestigation(com.mednet.executor.diagnostics.ExecTest1): Timed out after 50 seconds waiting for visibility of element located by By.id: lineItemForCounterBilling(..)
testInvestigation(com.mednet.executor.diagnostics.ExecTest6): Timed out after 50 seconds waiting for visibility of element located by By.id: lineItemForCounterBilling(..)
Tests run: 2, Failures: 2, Errors: 0, Skipped: 0
[ERROR] There are test failures.
Please refer to/var/lib/jenkins/workspace/MednetTestingFramework/target/surefire-reports for the individual test results.
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:19 min
[INFO] Finished at: 2016-08-25T11:06:08+05:30
[INFO] Final Memory: 34M/381M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/workspace/MednetTestingFramework/pom.xml to com.mednet/MednetTestingFrameworkV1/0.0.1-SNAPSHOT/MednetTestingFrameworkV1-0.0.1-SNAPSHOT.pom
channel stopped
Finished: UNSTABLE
Test stops after login steps that I have put in. There is nothing wrong with my Element as it locates without any problem in my Windows machine.
I searched on internet about the problem. In many sources I found out about Xvfb screen resolution is by default usually not large i suppose. So I am not able to
increase screen size
I tried many commands such as xvfb :99 -screen 0 1024*720 or 1440*900
But of no use it show invalid screen resolution.
Need help in solving like any important step that I may have missed out.
Thanks in advance

Related

docker build fails inside gitlab-runner but works locally : spring boot native compilation with GraalVm

I made a Dockerfile to build my spring boot project with GraalVm natively; everything went correctly.
Here is the Dockerfile
FROM ghcr.io/graalvm/graalvm-ce:22.3.1 AS buildnative
WORKDIR /app
COPY mvnw pom.xml ./
COPY .mvn/ .mvn
COPY src ./src
RUN ./mvnw clean package -Pnative
FROM ubuntu:23.04
EXPOSE 8080
COPY --from=buildnative /app/target/spring-boot-project /build/app
CMD ["/build/app"]
This runs perfectly locally, but in the GitLab runner, I always have the same error.
JAVA_HOME is not defined correctly.
We cannot execute /opt/graalvm-ce-java17-22.3.1/bin/java
The command '/bin/sh -c ./mvnw clean package -Pnative' returned a non-zero code: 1
So I decided to add some logs within the maven wrapper, and here is what I have :
Step 7/11 : RUN ./mvnw clean package -Pnative ---> Running in 81e0558130f3 ------------> /opt/graalvm-ce-java17-22.3.1/bin/java ------------> JAVA_HOME is /opt/graalvm-ce-java17-22.3.1 Error: JAVA_HOME is not defined correctly. We cannot execute /opt/graalvm-ce-java17-22.3.1/bin/java The command '/bin/sh -c ./mvnw clean package -Pnative' returned a non-zero code: 1 Cleaning up project directory and file based variables
Step 7/11 : RUN ./mvnw clean package -Pnative
---> Running in 81e0558130f3
------------> /opt/graalvm-ce-java17-22.3.1/bin/java
------------> JAVA_HOME is /opt/graalvm-ce-java17-22.3.1
Error: JAVA_HOME is not defined correctly.
We cannot execute /opt/graalvm-ce-java17-22.3.1/bin/java
The command '/bin/sh -c ./mvnw clean package -Pnative' returned a non-zero code: 1
Cleaning up project directory and file based variables
In the log I have added, we can see JAVA_HOME is defined and is adequately defined. It is the same as locally, where everything works perfectly.
I tried to add this line: RUN chmod +x mvnw before running it, but it did not change anything.
I need more ideas. Is there anyone have an idea of what is happening?
Edit:
I decided to dive deeper into the issue. I have added logs to know why it does not work. I modified the mvnw script to know what was happening.
I have added this to mvnw
if [ -e "$JAVACMD" ] ; then
echo "------------> THE FILE EXIST" >&2
else
echo "------------> THE FILE DOES NOT EXIST" >&2
fi
if [ -x "$JAVACMD" ] ; then
echo "------------> THE FILE IS EXECUTABLE" >&2
else
echo "------------> THE FILE IS NOT EXECUTABLE" >&2
fi
Results:
Here is in local:
------------> JAVACMD /opt/graalvm-ce-java17-22.3.1/bin/java
------------> THE FILE EXIST
------------> THE FILE IS EXECUTABLE
Here is in the gitlab-runner:
------------> JAVACMD /opt/graalvm-ce-java17-22.3.1/bin/java
------------> THE FILE EXIST
------------> THE FILE IS NOT EXECUTABLE
Makes no sense to me
Is your GitLab runner configured to use a non-root user when executing the Dockerfile?
As #jilliss pointed out, it seems that it's the Java binary that needs execute permission, but maybe only root has the permission (which is why it works locally as by default you will be running it as root).
If the Ops team have tried to run the Dockerfile as another user, then it could explain why /opt/graalvm-ce-java17-22.3.1/bin/java is no longer executable.
Try adding a whoami log and see which user is running when it runs in GL.
Correct compile command is
mvn -Pnative native:compile
You can see more details and full doc here. After that you will see graalvm build result in the logs. So you need to change your docker file like below
FROM ghcr.io/graalvm/graalvm-ce:22.3.1 AS buildnative
WORKDIR /app
COPY mvnw pom.xml ./
COPY .mvn/ .mvn
COPY src ./src
RUN ./mvnw native:compile -Pnative
FROM ubuntu:23.04
EXPOSE 8080
COPY --from=buildnative /app/target/spring-boot-project /build/app
CMD ["/build/app"]
example build log from my local build
[INFO] --- native-maven-plugin:0.9.19:compile (default-cli) # demo ---
Downloading: Component catalog from www.graalvm.org
Processing Component: Native Image
Downloading: Component native-image: Native Image from github.com
Installing new component: Native Image (org.graalvm.native-image, version 22.3.1)
[INFO] Found GraalVM installation from JAVA_HOME variable.
[INFO] [graalvm reachability metadata repository for ch.qos.logback:logback-classic:1.4.5]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for ch.qos.logback:logback-classic:1.4.5]: Configuration directory is ch.qos.logback/logback-classic/1.4.1
[INFO] Executing: /opt/graalvm-ce-java17-22.3.1/bin/native-image -cp /app/target/classes:/root/.m2/repository/org/springframework/spring-aop/6.0.4/spring-aop-6.0.4.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter-logging/3.0.2/spring-boot-starter-logging-3.0.2.jar:/root/.m2/repository/org/springframework/spring-context/6.0.4/spring-context-6.0.4.jar:/root/.m2/repository/org/springframework/spring-core/6.0.4/spring-core-6.0.4.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-api/2.19.0/log4j-api-2.19.0.jar:/root/.m2/repository/org/springframework/spring-expression/6.0.4/spring-expression-6.0.4.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.19.0/log4j-to-slf4j-2.19.0.jar:/root/.m2/repository/ch/qos/logback/logback-core/1.4.5/logback-core-1.4.5.jar:/root/.m2/repository/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar:/root/.m2/repository/org/springframework/spring-beans/6.0.4/spring-beans-6.0.4.jar:/root/.m2/repository/ch/qos/logback/logback-classic/1.4.5/logback-classic-1.4.5.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter/3.0.2/spring-boot-starter-3.0.2.jar:/root/.m2/repository/org/springframework/spring-jcl/6.0.4/spring-jcl-6.0.4.jar:/root/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.0.2/spring-boot-autoconfigure-3.0.2.jar:/root/.m2/repository/org/slf4j/jul-to-slf4j/2.0.6/jul-to-slf4j-2.0.6.jar:/root/.m2/repository/org/yaml/snakeyaml/1.33/snakeyaml-1.33.jar:/root/.m2/repository/org/springframework/boot/spring-boot/3.0.2/spring-boot-3.0.2.jar:/root/.m2/repository/org/slf4j/slf4j-api/2.0.6/slf4j-api-2.0.6.jar --no-fallback -H:Path=/app/target -H:Name=demo -H:ConfigurationFileDirectories=/app/target/graalvm-reachability-metadata/160481799c4b6c37cde925c9aebf513c32245dcf/ch.qos.logback/logback-classic/1.4.1
========================================================================================================================
GraalVM Native Image: Generating 'demo' (executable)...
========================================================================================================================
[1/7] Initializing... (6.6s # 0.23GB)
Version info: 'GraalVM 22.3.1 Java 17 CE'
Java version info: '17.0.6+10-jvmci-22.3-b13'
C compiler: gcc (redhat, x86_64, 11.3.1)
Garbage collector: Serial GC
1 user-specific feature(s)
- org.springframework.aot.nativex.feature.PreComputeFieldFeature
Field org.apache.commons.logging.LogAdapter#log4jSpiPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#log4jSlf4jProviderPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#slf4jSpiPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#slf4jApiPresent set to true at build time
Field org.springframework.core.NativeDetector#imageCode set to true at build time
Field org.springframework.format.support.DefaultFormattingConversionService#jsr354Present set to false at build time
Field org.springframework.core.KotlinDetector#kotlinPresent set to false at build time
Field org.springframework.core.KotlinDetector#kotlinReflectPresent set to false at build time
Field org.springframework.cglib.core.AbstractClassGenerator#imageCode set to true at build time
Field org.springframework.boot.logging.log4j2.Log4J2LoggingSystem$Factory#PRESENT set to false at build time
Field org.springframework.boot.logging.java.JavaLoggingSystem$Factory#PRESENT set to true at build time
Field org.springframework.boot.logging.logback.LogbackLoggingSystem$Factory#PRESENT set to true at build time
Field org.springframework.boot.logging.logback.LogbackLoggingSystemProperties#JBOSS_LOGGING_PRESENT set to false at build time
Field org.springframework.context.event.ApplicationListenerMethodAdapter#reactiveStreamsPresent set to false at build time
[2/7] Performing analysis... [*******] (60.8s # 2.15GB)
8,903 (88.31%) of 10,082 classes reachable
13,147 (64.27%) of 20,456 fields reachable
40,485 (56.88%) of 71,181 methods reachable
365 classes, 115 fields, and 1,191 methods registered for reflection
64 classes, 70 fields, and 55 methods registered for JNI access
4 native libraries: dl, pthread, rt, z
[3/7] Building universe... (8.9s # 2.03GB)
[4/7] Parsing methods... [***] (9.6s # 0.82GB)
[5/7] Inlining methods... [***] (3.7s # 2.16GB)
[6/7] Compiling methods... [*******] (48.2s # 1.97GB)
[7/7] Creating image... (5.6s # 1.60GB)
17.53MB (49.48%) for code area: 25,460 compilation units
17.60MB (49.66%) for image heap: 215,829 objects and 25 resources
312.40KB ( 0.86%) for other data
35.44MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 packages in code area: Top 10 object types in image heap:
936.87KB java.util 3.72MB byte[] for code metadata
594.27KB java.lang.invoke 2.07MB java.lang.String
469.21KB c.s.org.apache.xerces.internal.impl.xs.traversers 2.06MB java.lang.Class
455.78KB java.lang 1.68MB byte[] for general heap data
423.05KB com.sun.org.apache.xerces.internal.impl 1.60MB byte[] for java.lang.String
407.79KB com.sun.crypto.provider 765.10KB com.oracle.svm.core.hub.DynamicHubCompanion
375.00KB org.springframework.beans.factory.support 576.38KB java.util.HashMap$Node
371.71KB java.io 513.09KB int[][]
354.25KB java.util.concurrent 394.88KB java.lang.String[]
328.57KB java.text 394.65KB byte[] for reflection metadata
12.74MB for 405 more packages 3.23MB for 1771 more object types
------------------------------------------------------------------------------------------------------------------------
12.0s (8.0% of total time) in 35 GCs | Peak RSS: 3.04GB | CPU load: 5.08
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
/app/target/demo (executable)
/app/target/demo.build_artifacts.txt (txt)
========================================================================================================================
Finished generating 'demo' in 2m 29s.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:11 min
[INFO] Finished at: 2023-01-27T18:05:23Z
[INFO] ------------------------------------------------------------------------
Never tried gitlab runner myself, but have you tried to force the JAVA_HOME env path before maven command?
ENV JAVA_HOME=/opt/graalvm-ce-java17-22.3.1
RUN ./mvnw clean package -Pnative
hope it helps

How can I create and run SikuliX scripts on MacOS?

I'm trying to use Sikuli on MacOS to do some automation. I've downloaded the SikuliX IDE 2.0.4 from here, and Jython 2.7.2 from here, and put the two of them in the same directory as per instructions in the docs.
I'm running MacOS Catalina 10.15.7 and this is the Java version:
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)
I'm able to open the SikuliX IDE, however when I click on the "Take Screenshot" button all applications are minimized, including the ones I want to take a screenshot of, and that happens even if I open the application that I want to automate and use the SikuliX IDE shortcut to take a screenshot.
When this happens only the SikuliX menu bar, background and docker are visible. And even then, if I try to take a screenshot of a icon in the docker the image that opens up on the SikuliX IDE contains only the background, as if the docker is transparent.
I tried to take a screenshot using MacOS's default tools, but in this case when I try to run an instruction as simple as click() the script crashes.
This is the output of an attempt to click on the Finder icon in the docker:
[error] script [ create_new_folder ] stopped with error in line 1
[error] FindFailed ( finder_icon.png: (86x78) in R[0,0 1680x1050]#S(0) )
[error] --- Traceback --- error source first
line: module ( function ) statement
1: main ( <module> ) click("finder_icon.png")
[error] --- Traceback --- end --------------
I wasn't able to find much stuff about SikuliX on MacOS. Any suggestions on how I might be able to take screenshots and automate things on MacOS with SikuliX?
Reason behind: in the standard macOS now blocks taking screenshots.
Solution: This has to be allowed in the Prefs -> Security&Privacy -> Privacy -> ScreenRecording.

Execute selenise runner on Firefox

I am using selenise runner to run script in different browsers.
I am using this config file:
firefox: C://Users/Desktop/geckodriver.exe
highlight: Yes
baseurl: https://example.com/
set-speed: 1000
timeout: 30000
driver: firefox
xml-result: C://Users/Desktop/Selenise/XMLReport
html-result: C://Users/Desktop/Selenise/HTMLReport
and this command to execute the execute the jars and reports:
set webdriver.gecko.driver=C:\Users\Desktop\geckodriver.exe
set path=%path%;webdriver.gecko.driver;
java -jar cmdJars.jar TestCases\TestCase1.html --config config.txt --driver firefox --firefox "C://Program Files/Mozilla Firefox/firefox.exe"
I am getting this error log:
[2017-01-17 10:34:38.139 +05:30] [INFO] Start: Selenese Runner 3.0.0
[2017-01-17 10:34:38.357 +05:30] [INFO] Firefox binary: C://Program Files/Mozill
a Firefox/firefox.exe
java.lang.IllegalStateException: The path to the driver executable must be set b
y the webdriver.gecko.driver system property; for more information, see https://
github.com/mozilla/geckodriver. The latest version can be downloaded from https:
//github.com/mozilla/geckodriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:19
9)
at org.openqa.selenium.remote.service.DriverService.findExecutable(Drive
rService.java:109)
at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriver
Service.java:37)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExe
cutable(GeckoDriverService.java:95)
at org.openqa.selenium.remote.service.DriverService$Builder.build(Driver
Service.java:296)
at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(Firef
oxDriver.java:277)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:2
47)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:2
42)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:1
35)
at jp.vmi.selenium.webdriver.FirefoxDriverFactory.newInstance(FirefoxDri
verFactory.java:173)
at jp.vmi.selenium.webdriver.WebDriverManager$Builder.build(WebDriverMan
ager.java:77)
at jp.vmi.selenium.webdriver.WebDriverManager.get(WebDriverManager.java:
266)
at jp.vmi.selenium.selenese.Main.setupRunner(Main.java:139)
at jp.vmi.selenium.selenese.Main.run(Main.java:82)
at jp.vmi.selenium.selenese.Main.main(Main.java:221)
[2017-01-17 10:34:38.434 +05:30] [INFO] Exit code: 1
Also i have set webdriver.gecko.driver in the system environment variable.
why am I getting this error even after setting the path of gecko driver.
Version:
Gecko driver : geckodriver 0.13.0,
Selenise runner : Selenese Runner 3.0.0
Are you sure the webdriver.gecko.driver System Property is set?
You can pass this as a JVM argument (I had to on Mac since it doesn't really like dots in environment variables):
java -Dwebdriver.gecko.driver=/path/to/geckodriver -jar cmdJars.jar TestCases\TestCase1.html --config config.txt --driver firefox --firefox "C://Program Files/Mozilla Firefox/firefox.exe"
Please make sure -D appears before -jar, as above.

Opening import file for module <framework>: Permission denied

I set up a remote Git repository and Xcode Server on another computer, then created a bot in Xcode.
Every time I try to do a new integration, it fails with an error like this:
Assertion: Opening import file for module 'Accelerate': Permission denied
File: <filename>.swift:9
If I comment everything in this file, bot starts showing same error for another framework (and another .swift file). It can be either Swift or Objective-C framework.
Search Paths for this project is: $(PROJECT_DIR), and Always Search User Paths is set to Yes
I'm using Xcode 7.2 beta 2, but I was facing the same issue on Xcode 7.1 from the App Store. I tried restarting Xcode and both server and development Macs, it doesn't help. The project compiles and runs successfully on my development machine.
Server Logs: (xcsbuildd.log)
[BuildService] Previous integration is needed but not loaded yet, fetching.
[BuildService] Previous integration loaded successfully.
[BuildService] Completed integration step XCSCheckoutIntegrationStep without error
[BuildService, Info] Asset packs will be hosted at <server url here>
[BuildService] Current server devices are needed but not loaded yet, fetching.
[BuildService] Devices loaded successfully.
[BuildService, Info] Current server platforms are needed but not loaded yet, fetching.
[BuildService, Info] Platforms loaded successfully.
[BuildService] Creating arguments list for integrate
[BuildService] Integration will not perform analyze action
[BuildService] Integration will perform test action
[BuildService] Integration use scheme-level code coverage enabled setting
[BuildService] Additional build arguments are "(
)"
[BuildService, Info] Creating test device destination arguments for device testing
[BuildService, Info] Create test device destination arguments from device specification
[BuildService, Info] Including device iPhone 6 Plus (A3E8ED2D-4D13-420E-8CE1-6D484E65CD03)
[BuildService, Info] Destination arguments are (
"-skipUnsupportedDestinations",
"-destination-timeout",
30,
"-DVTDeviceLogLevel=3",
"-DVTDeviceSearchLogLevel=3",
"-iPhoneSimulatorLogLevel=3",
"-iPhoneConnectLogLevel=3",
"-destination",
"id=A3E8ED2D-4D13-420E-8CE1-6D484E65CD03"
)
[BuildService] Integrate arguments list is (
"/usr/bin/xcrun",
xcodebuild,
test,
"-IDETestOperationsObserverDebugLogLevel=3",
"-IDEBuildOperationMaxPercentageOfConcurrentCompileTasks=80",
"-IDEBuildOperationQueueSetResourceManagementLogLevel=2",
"-DTDKSupportWirelessDevices=NO",
"-IDEPostProgressNotifications=YES",
"-DVTAllowServerCertificates=YES",
"-DVTSigningCertificateSourceLogLevel=3",
"-DVTSigningCertificateManagerLogLevel=3",
"-DTDKProvisioningProfileExtraSearchPaths=/Library/Developer/XcodeServer/ProvisioningProfiles",
"-DTDKDisableSymbolCopying=YES",
"-scheme",
Newsfeeder,
"-skipUnavailableActions",
"-project",
"/Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/Source/Newsfeeder/Newsfeeder.xcodeproj",
"-derivedDataPath",
"/Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/DerivedData",
"-skipUnsupportedDestinations",
"-destination-timeout",
30,
"-DVTDeviceLogLevel=3",
"-DVTDeviceSearchLogLevel=3",
"-iPhoneSimulatorLogLevel=3",
"-iPhoneConnectLogLevel=3",
"-destination",
"id=A3E8ED2D-4D13-420E-8CE1-6D484E65CD03",
"-DVTSuppressExternalDeviceLocation=NO",
"-resultBundlePath",
"/Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild_result.bundle"
)
[BuildService] NSTask environment: {
"DEVELOPER_DIR" = "/Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer";
PATH = "/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin";
XCS = 1;
"XCS_BOT_ID" = 1770e1afb8f775d8c92855beba002640;
"XCS_BOT_NAME" = "Newsfeeder Bot";
"XCS_BOT_TINY_ID" = 8466E19;
"XCS_DERIVED_DATA_DIR" = "/Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/DerivedData";
"XCS_INTEGRATION_ID" = 1770e1afb8f775d8c92855beba008e0d;
"XCS_INTEGRATION_NUMBER" = 2;
"XCS_INTEGRATION_RESULT" = unknown;
"XCS_INTEGRATION_TINY_ID" = B989BD8;
"XCS_OUTPUT_DIR" = "/Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d";
"XCS_SOURCE_DIR" = "/Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/Source";
"XCS_XCODEBUILD_LOG" = "/Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild.log";
}
[BuildService] Running task /usr/bin/nice /usr/bin/xcrun xcodebuild test -IDETestOperationsObserverDebugLogLevel=3 -IDEBuildOperationMaxPercentageOfConcurrentCompileTasks=80 -IDEBuildOperationQueueSetResourceManagementLogLevel=2 -DTDKSupportWirelessDevices=NO -IDEPostProgressNotifications=YES -DVTAllowServerCertificates=YES -DVTSigningCertificateSourceLogLevel=3 -DVTSigningCertificateManagerLogLevel=3 -DTDKProvisioningProfileExtraSearchPaths=/Library/Developer/XcodeServer/ProvisioningProfiles -DTDKDisableSymbolCopying=YES -scheme Newsfeeder -skipUnavailableActions -project /Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/Source/Newsfeeder/Newsfeeder.xcodeproj -derivedDataPath /Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/DerivedData -skipUnsupportedDestinations -destination-timeout 30 -DVTDeviceLogLevel=3 -DVTDeviceSearchLogLevel=3 -iPhoneSimulatorLogLevel=3 -iPhoneConnectLogLevel=3 -destination id=A3E8ED2D-4D13-420E-8CE1-6D484E65CD03 -DVTSuppressExternalDeviceLocation=NO -resultBundlePath /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild_result.bundle
[BuildService, Info] Monitoring /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild.log for activity.
[BuildService, Info] Done monitoring xcodebuild.log for activity.
[BuildService] Scheme actions record is needed but not loaded yet, fetching.
[BuildService] Scheme actions record loaded successfully.
[BuildService] Completed integration step XCSBuildIntegrationStep without error
[BuildService] Last integration with build results is needed but not loaded yet, fetching.
[BuildService] Last integration with build results loaded successfully.
[BuildService] Build results summary: {
analyzerWarningChange = 0;
analyzerWarningCount = 0;
codeCoveragePercentage = 0;
codeCoveragePercentageDelta = 0;
errorChange = 0;
errorCount = 1;
improvedPerfTestCount = 0;
regressedPerfTestCount = 0;
testFailureChange = 0;
testFailureCount = 0;
testsChange = 0;
testsCount = 0;
warningChange = 0;
warningCount = 0;
}
[BuildService] Integration commit history are needed but not loaded yet, fetching.
[BuildService] Integration commits loaded successfully.
[BuildService] Completed integration step XCSProcessBuildResultsIntegrationStep without error
[BuildService] Matched device <XCSDevice 0x7fc77e82eaf0>
{"modelUTI":"com.apple.iphone-6-plus-b4b5b9","connected":"YES","modelCode":"iPhone7,1","simulator":"YES","osVersion":"9.2","modelName":"iPhone 6 Plus","supported":"YES","deviceUDID":"A3E8ED2D-4D13-420E-8CE1-6D484E65CD03","identifier":"A3E8ED2D-4D13-420E-8CE1-6D484E65CD03","enabledForDevelopment":"YES","architecture":"x86_64","isServer":"NO","tinyID":"A3E8ED2","doc_type":"device","trusted":"YES","platformIdentifier":"com.apple.platform.iphonesimulator","name":"iPhone 6 Plus","retina":"YES"} to server device <XCSDevice 0x7fc77e398d70>
{"osVersion":"9.2","connected":"YES","simulator":"YES","modelCode":"iPhone7,1","deviceType":"com.apple.iphone-simulator","modelName":"iPhone 6 Plus","revision":"6-71966f4a54eb01b83604036d5b31c53c","modelUTI":"com.apple.iphone-6-plus-b4b5b9","doc_type":"device","trusted":"YES","name":"iPhone 6 Plus","supported":"YES","identifier":"A3E8ED2D-4D13-420E-8CE1-6D484E65CD03","enabledForDevelopment":"YES","platformIdentifier":"com.apple.platform.iphonesimulator","ID":"11f2b4085b58a3769cd320245b004ab9","architecture":"x86_64","retina":"NO","isServer":"NO","tinyID":"37889F2"}
[BuildService] Processing device: <XCSDevice 0x7fc77e398d70>
{"osVersion":"9.2","connected":"YES","simulator":"YES","modelCode":"iPhone7,1","deviceType":"com.apple.iphone-simulator","modelName":"iPhone 6 Plus","revision":"6-71966f4a54eb01b83604036d5b31c53c","modelUTI":"com.apple.iphone-6-plus-b4b5b9","doc_type":"device","trusted":"YES","name":"iPhone 6 Plus","supported":"YES","identifier":"A3E8ED2D-4D13-420E-8CE1-6D484E65CD03","enabledForDevelopment":"YES","platformIdentifier":"com.apple.platform.iphonesimulator","ID":"11f2b4085b58a3769cd320245b004ab9","architecture":"x86_64","retina":"NO","isServer":"NO","tinyID":"37889F2"}
[BuildService] Completed integration step XCSProcessTestResultsIntegrationStep without error
adding: xcodebuild_result.bundle/ (stored 0%)
adding: xcodebuild_result.bundle/1_Test/ (stored 0%)
adding: xcodebuild_result.bundle/1_Test/action.xcactivitylog (stored 0%)
adding: xcodebuild_result.bundle/1_Test/build.xcactivitylog (deflated 1%)
adding: xcodebuild_result.bundle/Info.plist (deflated 79%)
[BuildService] Uploading file /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild_result.bundle.zip
[BuildService] Uploading file /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/buildService.log
[BuildService] Uploading file /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild.log
[BuildService] Uploading file /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/sourceControl.log
[BuildService] Uploading file /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/Session-2015-11-04_16:54:03-zpFYIF.log to relative path (null)
[BuildService] Completed integration step XCSUploadFilesIntegrationStep without error
[BuildService] Integration executor is finished. Exiting.
[BuildService] Registering build service socket listeners
[BuildService] Done registering build service socket listeners
I had the same error when I tried to build and run the tests for my own framework on continuous integration server (Xcode Service Bots). The problem was first observed after upgrading my Server app to Version 5.1 (15S5127) and Xcode to Version 7.3 (7D175).
In my case the solution turned out to be quite surprising. It took me lots of time to realise that the problem only shows up when I use Nimble framework. When I remove import Nimble from my test and use standard XCTest assertions, the problem goes away.
What helped in my case was making sure that before integration, the Nimble framework is rebuilt. I am using Nimble with Carthage, so I only had to add the following command in the Before Integration Trigger:
cd NimbleCarthageProblem && /usr/local/bin/carthage bootstrap --platform iOS
See also screenshot:
After that it builds and tests run successfully.
From your logs I can't see if you are using Nimble - if you do not, than it means that the problem is somewhere else and I just experienced its another revelation.
I still do not understand why is the problem only happening on the build server during integration. Even if I log into build machine, check out the source code, and build it with Xcode right there - everything is fine. It only fails on the bot during integration. The solution is not ideal for another reason: Nimble has to be rebuilt before each integration and cannot just be included in the source code (if one finds this a better approach).
If I hope someone else will find the actual solution. I do not blame Nimble - it is most certainty a combination of things.
I created an example project where the problem and the solution are described in more details. It can be found here: https://github.com/mczenko/NimbleCarthageProblem.

Trying to install HTTP::Server::Brick on Strawberry Perl on Windows 7

Here's what I see when I run cpan to install it.
cpan shell -- CPAN exploration and modules installation (v1.9800)
Enter 'h' for help.
cpan> install HTTP::Server::Brick
Database was generated on Fri, 13 Jul 2012 03:26:42 GMT
Running install for module 'HTTP::Server::Brick'
Running make for A/AU/AUFFLICK/HTTP-Server-Brick-0.1.4.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\A\AU\AUFFLICK\HTTP-Server-Bri
ck-0.1.4.tar.gz ok
Scanning cache C:\strawberry\cpan\build for sizes
............................................................................DONE
CPAN.pm: Building A/AU/AUFFLICK/HTTP-Server-Brick-0.1.4.tar.gz
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'HTTP-Server-Brick' version '0.1.4'
Building HTTP-Server-Brick
AUFFLICK/HTTP-Server-Brick-0.1.4.tar.gz
C:\strawberry\perl\bin\perl.exe ./Build -- OK
Running Build test
t\00.load.t ....... 1/1 # Testing HTTP::Server::Brick v0.1.4
t\00.load.t ....... ok
t\pod-coverage.t .. skipped: Test::Pod::Coverage 1.04 required for testing POD c
overage
t\pod.t ........... skipped: Test::Pod 1.14 required for testing POD
t\serving.t ....... 1/281 #
#
# Using port: 85432 and host: 127.0.0.1 for test server.
# If these are not suitable settings on your machine, set the environment
# variables HSB_TEST_PORT and HSB_TEST_HOST to something suitable.
#
# Configuring server
# Starting server
t\serving.t ....... 4/281
It's really quite simple... Why port 85432? It's outside the 16 bit unsigned integer range! I can't even enter localhost:85432 in any URL bars, Chrome just sends me straight to Google search.
That is pretty strange. I took a look at the source for the test in question, and it has this:
my $port = $ENV{HSB_TEST_PORT} || 85432;
No idea why the author chose that as the default port number, since as you know it's invalid. I guess there's zero chance of the port being in use, though!
My suggestion would be to set the environment variable HSB_TEST_PORT to something more reasonable and try to install again, and file a bug report in the meantime.

Resources