Cocoapods Quality Indexes : "tested" label not checked - ios

I have an SDK published with cocoapods.
Recently I made an update including a testing target.
Normally I should see the label tested checked but that doesn't happen. I double checked that the target is shared.
So my question here, Is there something special to add in Podspec ? Did they use some CI tools like TravisCI or jenkins to test the project.
I can't find something useful in the official documentation
https://guides.cocoapods.org/making/quality-indexes.html

After some researches, I found the answer in cocoapods source code :
Apperantly they are only checking the label if the pod has more than 5 tests which is not my case.
Check it here :
https://github.com/CocoaPods/cocoapods.org/blob/master/views/pod.slim#L9
has_tests = #cocoadocs["total_test_expectations"] > 5
tested_description = #cocoadocs["total_test_expectations"] > 20 ? "Tested" : "Well Tested"

Related

Xcode does not simply run tests - no scheme and/or test plan

Objective
Running simple unit-test for an iOS app.
Setup
Xcode (Version 14.1)
Sample Test:
import XCTest
#testable import SDKTestAppSwift
class SDKTestAppSwiftTests: XCTestCase {
func testExample() throws {
print("Test: testExample")
// This is an example of a functional test case.
let base = "asdfghjkl123"
XCTAssert(base == "asdfghjkl123")
}
}
Next to the ..
func testExample() throws {
.. Xcode provides a nice little 'start single test'-button.
I used to klick it to start the test, locally (Xcode IDE on mac).
This used to work properly.
Problem
Klicking the 'start single test'-button, an overlay appears:
For the sake of this question to be machine-readable:
There is no scheme and/or test plan that contains every test you are trying to run.
Create a new scheme and/or test plan containing the tests you want to run.
To close the overlay an 'OK'-Button is delivered only.
Misleading solution (?!)
Just before there was no such scheme needed.
I wonder why would that changes 'suddenly'.
From my point ov view Scheme/Testplans are executed 'on startup' of the device-emulator (or likewise), which is not my objective in the first place.
However - creating a TestPlan via:
File > New > File... > TestPlan
Adding the SDKTestAppSwiftTests-class using the +-Button.
... no success ... :-/
Several other attempts
It seems my system is not the only one facing likewise issues.
Problems with naming of test plans
xcodebuild: Tests cannot be run because the test plan “Scheme” could not be read
No matter if there is a 'test-plan' and whatever name I assigned it - this is no solution.
Default test plan
https://developer.apple.com/forums/thread/133495
I seriously do not know how to create a 'default test plan' if it was not the way decribed before.
Quit Xcode and delete 'old configurations'
Xcode: No Scheme
xcodebuild says does not contain scheme
Something about files with old configurations which have to be deleted
In this case I am not sure which file and where to find it exactly.
Conclusion
Even though one of the obove may help you, for me the issue is not solved, yet.
Anyways
Thanks for reading & sharing - any help is appreciated :)
For me I fixed this through my scheme → Edit Scheme → Test → Plus Sign (Add Test Target) and then adding my unit test target.
There is another solution ...
First - Manage Schemes
Second - Create new Scheme
Third -> Celebrate, it's done .. :)

Cytoscape - Set nodeCustomGraphicsSizeSync and nodeSizeLocked from CyREST

Is there a way to programatically set nodeCustomGraphicsSizeSync and nodeSizeLocked in Cytoscape with the CyRest api ?
They are usually set in the UI by the two checkboxes "Fit Custom Graphics to node" and "Lock node width and height" (see image).
I tried this, which does not work:
from py2cytoscape.data.cyrest_client import CyRestClient
cy = CyRestClient()
my_style = cy.style.create('custom_theme', original_style=cy.style.get('default'))
net = cy.network.create(name='My Network', collection='My network collection')
my_style.update_defaults({
'NODE_SIZE':200, #works
'NODE_CUSTOMGRAPHICS_SIZE_1':80, #works,
'NODE_CUSTOMGRAPHICS_POSITION_1':'N,S,c,0.00,0.00', #works
'nodeCustomGraphicsSizeSync' : 'false', # does not work
'nodeSizeLocked' : 'false' # does not work
})
cy.style.apply(my_style, net)
I think it is because these are not VisualProperties but Visual Property Dependencies
I found this mention of a related issue, but no other references (the redmine seems down):
3245 Creating a copy of a VisualStyle--VisualPropertyDependencies not copied
from https://cytoscape.org/cy3_welcome_letter_v14.pdf
I'm using Cytoscape 3.7.2 and py2cytoscape.
There is a way in CyREST, but I'm not sure it's been made available through py2cytoscape. Basically, you need to update the dependencies, which is a different REST endpoint (/{name}/dependencies) and you want to use "enabled" rather than "true". You may want to see if there is an update_dependencies in py2cytoscape (I don't see one after a quick look at the docs). If not, add an issue in github: https://github.com/cytoscape/py2cytoscape
-- scooter

Jira : Query inside linkedIssues

We create jiras for tracking a release in a separate project. For eg: there is a project called Release and there will be jiras like Release-1, Release-2, Release-3. The actual code jiras for each release are linked to the release jira- something like Dev-1,Dev-2 linked to Release-1, Dev-3,Dev-4 linked to Release-2 etc. Each release jira has a type defined. I want to find all the dev jiras that are linked to the release jiras which has type say "XYZ". How can i achieve that? Tried out issue in linkedIssues() but its not working.
Is your issue related to this: I cannot run issueFunction in JQL
If you mean "issues" by "jiras"
then please refer to the following example:
Jira Project Release
Release-1 > linked to Dev-1, Dev-2
Release-2 > linked to Dev-3, Dev-4
Jira Project Dev
Dev-1 (bug) > linked to Release-1
Dev-2 (story) > linked to Release-1
Dev-3 (bug) > linked to Release-2
Dev-4 (story) > linked to Release-2
Say I want to query all the bugs in Dev project related to Release-1. Please take note that you will need to have the Adaptavist Scriptrunner Jira plugin.
issueFunction in linkedIssuesOfAll("issue in (Release-1)") and type = Bug

How do I get code coverage for all branches using Pester?

Multiple test cases have been written to test a new Chocolatey function using Pester. How do check whether all branches have been covered?
The current version of Pester (3.0) does support code coverage.
Simply use
Invoke-Pester -CodeCoverage *.ps1
to get a full rapport of code coverage (coverage %) and a summary of all the code lines (branches) not executed during testing:
Tests completed in 10.11s
Passed: 66 Failed: 0 Skipped: 0 Pending: 0
Code coverage report:
Covered 99,20 % of 501 analyzed commands in 22 files.
Missed commands:
File Function Line Command
---- -------- ---- -------
Set-ProgressColor.ps1 Set-ProgressColor 19 Write-Verbose "Progress colors are only supported on the PowerShell com...
UPDATE 2:
Thanks to oɔɯǝɹ for pointing out that Pester has now released a version of Pester that supporting code coverage.
UPDATE 1:
As of Pester Version 3.0, it is now possible to get code coverage information, using:
Invoke-Pester -CodeCoverage <path to file>
This is documented in the project wiki page:
https://github.com/pester/Pester/wiki/Code-Coverage
NOTE: In order to use this, you will require PowerShell version 3.0
ORIGINAL ANSWER:
To the best of my knowledge, Pester doesn't currently support code coverage analysis, but it is something that is being worked on.
There is an open issue for this feature here:
https://github.com/pester/Pester/issues/53
You can see it being worked on here:
http://davewyatt.wordpress.com/2014/06/29/code-coverage-analysis-for-pester-feedback-request/
And there is a screenshot of it working here:
https://twitter.com/nohwnd/status/485093995929157632
So basically, hold tight, and there will hopefully be something soon.
In terms of the actual Chocolatey code base, there is quite a good convention being used, namely that for each *.ps1 file, there "should" be a corresponding ".Tests.ps1 file. If this second file doesn't exist, then there are no unit tests for that function.

Running F# xUnit Fact from TestDriven.NET reporting "It looks like you're trying to execute an xUnit.net unit test."

I am trying to run xUnit tests (from an F# module, if it makes any difference) using TestDriven.NET, but whatever I do I get this error:
It looks like you're trying to execute an xUnit.net unit test.
For xUnit 1.5 or above (recommended):
Please ensure that the directory containing your 'xunit.dll' reference also contains xUnit's
test runner files ('xunit.dll.tdnet', 'xunit.runner.tdnet.dll' etc.)
For earlier versions:
You need to install support for TestDriven.Net using xUnit's 'xunit.installer.exe' application.
You can find xUnit.net downloads and support here:
http://www.codeplex.com/xunit
I tried following the suggestions, i.e. I copied the files
xunit.dll.tdnet
xunit.extensions.dll
xunit.gui.clr4.exe
xunit.runner.tdnet.dll
xunit.runner.utility.dll
xunit.runner.utility.xml
xunit.xml
to the folder with xunit.dll and I ran xunit.installer.exe. How can I get it to work?
I just figured out that I forgot to make the test a function in F# (so it was just a value). The error message can't be more misleading though!
You have two problems:
your Fact is broken:-
If you hover over the
please work
bit, you'll see something like: unit -> int
For a Fact to be picked up by an xUnit runner, it needs to yield `unit (void).
Hence, one key thing to get right first is to not return anything. In other words, replace your 123 with () (or an Assertion).
You can guard against this by putting a :unit stipulation on the test:-
[<Fact>]
let ``please work`` () : unit = 123
This will force a compilation error.
TestDriven.NET is reporting it cannot find the xunit.tdnet modules
It's critical to get step 1 right first. Then retry and the problem should be gone
If it remains...
Either try the VS-based runner which should work as long as it's installed and xunit.dll is getting to your output dir or look at the docs for your version of TD.NET for detailed troubleshooting notes (exec summary is if the .tdnet file was in your out dir or you undo and redo the xunit.installer from the folder containing the packages it should just work, esp if you are on latest)

Resources