cocoapods.org icon indicating copy to clipboard operation
cocoapods.org copied to clipboard

Pod page not recognizing Swift Framework as `Tested`.

Open nmdias opened this issue 7 years ago • 10 comments

Report

Pod page not recognizing Swift Framework as Tested.

I had a Tests folder, and moved tests into a Tests/FeedKitTests folder. And the issue appeared when I published version 6.0.0 of the framework.

I have then moved the tests back from Tests/FeedKitTests to the Tests folder. I also updated my Package.swift to exclude the Tests folder.

Published version 6.0.1 and the issue still occurs.

What did you do?

Run pod trunk push FeedKit.podspec

What did you expect to happen?

Pod to be identified as Tested in the https://cocoapods.org/pods/FeedKit page

What happened instead?

Pod is identified as not being tested

CocoaPods Environment

Stack

   CocoaPods : 1.2.1
        Ruby : ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
    RubyGems : 2.6.12
        Host : Mac OS X 10.12.5 (16F73)
       Xcode : 8.3.3 (8E3004b)
         Git : git version 2.11.0 (Apple Git-81)
Ruby lib dir : /Users/nmdias/.rvm/rubies/ruby-2.4.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ bcbc488ed297f9e21f831edd313a8857770aaadf

Installation Source

Executable Path: /Users/nmdias/.rvm/gems/ruby-2.4.0/bin/pod

Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.2.0
cocoapods-try         : 1.1.0

Project that demonstrates the issue

The FeedKit repo, as is.

nmdias avatar Jun 13 '17 10:06 nmdias

Published version 6.0.2 now, but with no luck it seems.

nmdias avatar Jun 13 '17 16:06 nmdias

We're facing the same problem with https://cocoapods.org/pods/SwifterSwift Not only with tests, but website is not showing neither README nor CHANGELOG!

omaralbeik avatar Jul 21 '17 13:07 omaralbeik

@omaralbeik I'm having the same problem where both the README and CHANGELOG have disappeared: https://cocoapods.org/pods/Blockly I see that your repo has been fixed -- could you share how you fixed it?

vicng avatar Jul 27 '17 00:07 vicng

@vicng First I tried api.cocoadocs.org:4567/redeploy/SwifterSwift/3.0.0, which didn't change anything for a few days, then suddenly after v3.1.0 release yesterday I saw the page was working!

I'm not sure was it because of the URL call, the new release or someone at cocoapods took care of it 😅

omaralbeik avatar Jul 27 '17 08:07 omaralbeik

In my case, I had some non utf-8 characters in the *.swift files of my Tests target. After removing them, it successfully recognised the framework as tested.

here, here and here

nmdias avatar Jul 27 '17 09:07 nmdias

Same problem with https://cocoapods.org/pods/Siesta as well. The new version has only modest changes from the old one, which I'm pretty sure did show as tested. If that memory is correct, then this is a regression introduced since Mar 28.

pcantrell avatar Aug 07 '17 05:08 pcantrell

@orta / other project maintainers: Where in the code does that “Tests ✗” in the right margin come from?

I dug into the code, but had trouble figuring it out. At first I thought I’d discovered it in testing_idealist.rb. However, that class is recognizing Siesta’s tests correctly. We can verify that it’s working even on the live site because it’s used to generate this image, which says “Great Tests” even while Siesta’s pod page has the dreaded ✗ next to Tests.

If anyone can point me in the right direction, I'll try to diagnose.

pcantrell avatar Aug 17 '17 21:08 pcantrell

Well, after more digging:

  1. Gosh, it sure seems like testing_idealist is the only source of a test count in the whole CocoaPods/Docs universe.
  2. If it is an encoding problem, the likely culprit is this line. AFAICT, that should already default to UTF-8 — so forcing UTF-8 wouldn’t help. But perhaps the problem is that the pod source files aren’t being cloned as UTF-8. If so, that could conceivably cause “invalid byte sequence” errors when it tries to do the regex matches. A super-safe fix would be to use binary encoding (File.read file_path, encoding: 'binary' on the line linked above), which is perfectly fine since that part of the code is only looking for ASCII patterns and can safely just ignore all the funny bytes. But since I can’t seem to reproduce the problem, I can’t test that fix…. 😠
  3. Another possibility is that there’s no problem with encodings at all, but rather this line is causing CocoaDocs to skip the test analysis altogether. Is there any possibility that there could be a race condition for newly deployed pods where the list of versions sometimes doesn’t include the newly deployed one, and thus that line fails?
  4. For reference, this same bug also seems to have received discussion (but no solution) in https://github.com/CocoaPods/cocoadocs.org/issues/523.

pcantrell avatar Aug 17 '17 23:08 pcantrell

@pcantrell try running your tests with an old ruby version, since my guess is what's running on the server is not 2.4.1 and might have a different version of icu and thus handle unicode text differently

segiddins avatar Aug 18 '17 03:08 segiddins

I tried my local tests with both 2.1.3 and 2.3.1 (the versions that appear in the .ruby-version files in possibly relevant Strata projects). This is my test:

require_relative 'cocoadocs'
t = TestingIdealist.new
t.download_location = 'local/path/to/siesta/'
t.testimate

…and it gives nonzero output with both those old versions of ruby. Could there be an OS difference? I'm running these on a Mac; is the production version of cocoadocs.org generated on Linux perhaps?

pcantrell avatar Aug 18 '17 06:08 pcantrell