openbakery / gradle-xcodePlugin

gradle plugin for building Xcode Projects for iOS, watchOS, macOS or tvOS
Apache License 2.0
455 stars 127 forks source link

correctly running unit tests displays "All 0 tests were successful" #430

Open jimadamsss opened 4 years ago

jimadamsss commented 4 years ago

This appears to be an issue with Xcode 11. I have 11.5 and 0.19.1 version of the plugin but the files the testResultsParser is looking for are not there. I have been trying to get my code coverage updated using the xccov and noticed this message. My build works just fine, it just can't find the results.

ls build/derivedData/Logs/Test LogStoreManifest.plist Test-SASCollector-2020.06.01_14-11-54--0400.xcresult

and the xcresult directory contains a lot of files with base64 style file names. the code in the plugin appears to be looking for this pattern: 'TestSummaries.plist .xcresult/*_Test/action_TestSummaries.plist'

renep commented 4 years ago

Can you try the latest 0.20.0 hat I have released today. I wanted to release this version a long time ago because it fixes some compatibility issues with Xcode 11.4+.

It should also fix the issue the the unit tests results are not found.

jimadamsss commented 4 years ago

I was unable to run with 0.20.0. I go this error: Could not find any version that matches org.pegdown:pegdown:1.6.+. Versions that do not match:

jimadamsss commented 4 years ago

Do we really need pegdown for anything than building documentation? Seems like I shouldn't need to to run a build.

renep commented 4 years ago

Can you apply the plugin with following code in your build.gradle:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
        mavenCentral()
  }
  dependencies {
    classpath "gradle.plugin.org.openbakery:plugin:0.20.0"
  }
}

apply plugin: "org.openbakery.xcode-plugin"

The problem is that the gradle maven repo does not know pegdown. Pegdown is uses for release notes, and I will create an issue to get rid of it in the next release.

Update: see #431

jimadamsss commented 4 years ago

Ok. That works. Looks like there are some extra logging statements that need to be cleaned up:

Task :buildForTest org.openbakery.CommandRunner@4c778285Tests started!

Run tests for: iPhone X/iOS Simulator/13.5 60 tests completed

Task :testFramework org.openbakery.CommandRunner@21509dcfPath: /Applications/Xcode.app/Contents/Developer/usr/bin/xcresulttool All 60 tests were successful

BUILD SUCCESSFUL in 6m 58s

I ran with no --info or --debug