Jenkins将构建标记为失败,尽管所有测试用例都已通过iOS应用程序

时间:2017-02-24 07:55:31

标签: ios jenkins xcodebuild

我正在使用Jenkins作业运行iOS app的当前测试用例。使用,

<Window x:Name="windowsForm" x:Class="Vorschau.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Vorschau"
        mc:Ignorable="d"
        Title="Vorschaukomponente" Height="514.583" Width="805.208" FontFamily="Century Gothic" WindowStartupLocation="Manual" BorderThickness="0" ResizeMode="NoResize" WindowStyle="None" Icon="img/coordinates.ico" Background="{x:Null}" AllowsTransparency="True">
    <Window.Resources>

        <Style x:Key="border_res" TargetType="{x:Type Border}">
            <Setter Property="Background" Value="#3A3A3B" />
            <Setter Property="CornerRadius" Value="10" />
        </Style>
    </Window.Resources>

    <Border Style="{StaticResource border_res}">
        <Grid>
            <Canvas HorizontalAlignment="Left" Height="60" VerticalAlignment="Top" Width="185" Background="#FFE57E31">
                <Canvas Height="64" Canvas.Top="451" Width="185" Background="#FF2C373F">
                    <Label x:Name="lbCopyright" Content="©  Name 2017" Canvas.Left="10" Canvas.Top="29" Width="121" Foreground="#FF1B1D1F"/>
                </Canvas>
                <Canvas Height="391" Canvas.Top="60" Width="185" Background="#FF37424A">
                    <Button x:Name="btVorschau" Content="Vorschau" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="185" Height="50" Foreground="LightGray" FontSize="16"
                HorizontalContentAlignment="Left" BorderBrush="{x:Null}" Click="Button_Click">
                        <Button.Style>
                            <Style TargetType="{x:Type Button}">
                                <Setter Property="Background" Value="#FF37424A"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="{x:Type Button}">
                                            <Border Background="{TemplateBinding Background}">
                                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            </Border>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter Property="Background" Value="#FF303B43"/>
                                        <Setter Property="Foreground" Value="Red"/>
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                    </Button>
                    <Button x:Name="btEinstellung" Content="Einstellung" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="185" Height="50" Foreground="LightGray" FontSize="16"
                        HorizontalContentAlignment="Left" BorderBrush="{x:Null}" Canvas.Top="50" Click="btEinstellung_Click">
                        <Button.Style>
                            <Style TargetType="{x:Type Button}">
                                <Setter Property="Background" Value="#FF37424A"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="{x:Type Button}">
                                            <Border Background="{TemplateBinding Background}">
                                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            </Border>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter Property="Background" Value="#FF303B43"/>
                                        <Setter Property="Foreground" Value="Red"/>
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                    </Button>
                </Canvas>
                <Canvas Height="60" Canvas.Left="185" Width="618" Background="#FFEEE9ED">
                    <Label x:Name="lbClose" Content="X" Canvas.Left="578" FontSize="20" MouseDoubleClick="lbClose_MouseDoubleClick"/>
                    <Label x:Name="lbMinimize" Content="-" Canvas.Left="556" FontSize="22" Canvas.Top="-2" MouseDoubleClick="lbMinimize_MouseDoubleClick"/>
                    <Label x:Name="lbWhereIAm" Content="Label" Canvas.Left="10" Canvas.Top="15" Width="162" FontSize="20"/>
                </Canvas>
                <Canvas x:Name="canvasContent" Height="455" Canvas.Left="185" Canvas.Top="60" Width="618" Background="#FFD1CFD0"/>
                <Image x:Name="image" Height="38" Canvas.Left="10" Canvas.Top="10" Width="38" Source="img/coordinatesWhite.png"/>
                <Label x:Name="lbLogoname" Content="Vorschaukomponente" Canvas.Left="37" Canvas.Top="10" Width="143" FontWeight="Bold" Foreground="White"/>
            </Canvas>
            <ContentControl x:Name="conCon" Content="ContentControl" Canvas.Left="86" Canvas.Top="31" Margin="185,60,0,0" Foreground="#FF002EFF"/>
        </Grid>
    </Border>
</Window>

尽管所有测试都是成功的,但Jenkins仍将构建标记为失败。

我如何看到实际结果?

enter image description here

编辑-1:

即使我删除xcodebuild test ... | xcpretty ,仍然会将作业标记为失败。这是完整的shell命令,

| xcpretty

1 个答案:

答案 0 :(得分:0)

最后,问题通过在jenkins shell开头的下面放置

来解决

#!/bin/sh