Coder Social home page Coder Social logo

php-codacy-coverage's People

Contributors

azettl avatar captn3m0 avatar caxaria avatar ghriim avatar grummfy avatar haffla avatar josemiguelmelo avatar julien-boudry avatar kirillkomlev avatar lolgab avatar machadoit avatar maspeng avatar mrfyda avatar nmatpt avatar nyholm avatar ottlinger avatar pedrorijo91 avatar peter279k avatar rtfpessoa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-codacy-coverage's Issues

Autoload failed

Hello.

This is mistake in https://github.com/codacy/php-codacy-coverage/blob/master/bin/codacycoverage#L5

Why this line should be looked for first?

It's really BAD idea use vendor/bin at first.

For example, I have global installed codacycoverage. I go to a project with vendor dir, where codacycoverage not installed (but has autoload.php). So codacycovarage take those autoload instead own.

I test various situation with codacycoverage:

  • global installed
  • project installed (from composer)
  • codacycoverage installed from git clone

and run codacycoverage with different platform (Windows, Linux, Mac OS X) in differrent folders (in root repo, in vendor dir, in /tmp dir, in repo dir with vendor without codacycoverage installed). It's work fine with those lines:

$files = array(
    __DIR__ . "/../../vendor/autoload.php",
    __DIR__ . "/../../../autoload.php",
    dirname(__DIR__) . "/vendor/autoload.php"
);

NO other line should specified.

A line "vendor/autoload.php really buggy, and not work. Please, remove it.

Uncaught error - curl_init() undefined

Hey guys,

I'm trying to upload code coverage via a new ubuntu 14.04 installation that I've setup with Jenkins (I've managed to get code coverage working on my local mac). After I run unit tests, I issue the following command:

php vendor/bin/codacycoverage clover tests/coverage.xml

and end up with this stack trace:

PHP Fatal error:  Uncaught Error: Call to undefined function Codacy\Coverage\Util\curl_init() in /var/lib/jenkins/workspace/develop-test/vendor/codacy/coverage/src/Codacy/Coverage/Util/CodacyApiClient.php:30
Stack trace:
#0 /var/lib/jenkins/workspace/develop-test/vendor/codacy/coverage/src/Codacy/Coverage/Command/Clover.php(69): Codacy\Coverage\Util\CodacyApiClient->sendCoverage('a5b73dac5497864...', '{"total":44,"fi...')
#1 /var/lib/jenkins/workspace/develop-test/vendor/symfony/console/Command/Command.php(259): Codacy\Coverage\Command\Clover->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/lib/jenkins/workspace/develop-test/vendor/symfony/console/Application.php(844): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/lib/jenkins/workspace/develop-test/vendor/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRunCom in /var/lib/jenkins/workspace/develop-test/vendor/codacy/coverage/src/Codacy/Coverage/Util/CodacyApiClient.php on line 30

Any ideas?

Use symfony/console for bin/codacycoverage

I can help you to rewrite ugly bin/codacycoverage by using symfony/console dependcies (this add requirements in composer.json)

This will be like this:

#!/usr/bin/env php
<?php

require 'vendor/autoload.php';

$app = new \Codacy\Coverage\Application();
$app->run();

And split clover and phpunit by dedicated \Codacy\Coverage\Command classes.

I can do this work, if you wanted.

In ReferenceBag: Unable to parse "refs/original/refs/heads/master"

PHP Version

7.3

Test framework

Laravel / PHPUnit

Operating System

  • MacOS | 10.14.6
  • Homestead | v9.0.0
  • Settler | v8.0.0
  • Virtual Box | 6.0.12
  • Ubuntu | 18.04.3 LTS (GNU/Linux 4.15.0-58-generic x86_64)

Actual Behavior

Commands

php vendor/bin/phpunit --coverage-clover build/coverage/xml

php vendor/bin/codacycoverage clover build/coverage/xml

image

Code

composer.json

   "require-dev": {
        "codacy/coverage": "^1.4",
    },

phpunit.xml

   <logging>
        <log type="coverage-html" target="./reports" lowUpperBound="50" highLowerBound="80" />
    </logging>

Bad autoload.php requires

Hi, everybody.

I have a problem with using codacycoverage as global composer utility.
For example, I have 10 projects, and all of them has build/logs/clover.xml. All projects use codacy. Because I have composer I want install global utility:

composer global require codacy/coverage dev-master

Now, script in ~/.composer/vendor/bin/codacycoverage. I'm go to a project dir

cd ~/Projects/Project1
export CODACY_PROJECT_TOKEN="v3ryl0ngt0k3n"
codacycoverage clover
PHP Warning:  require(vendor/autoload.php): failed to open stream: No such file or directory in /Users/komnac/.composer/vendor/codacy/coverage/bin/codacycoverage on line 4

Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in /Users/komnac/.composer/vendor/codacy/coverage/bin/codacycoverage on line 4
PHP Fatal error:  require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/local/Cellar/php55/5.5.24/lib/php') in /Users/komnac/.composer/vendor/codacy/coverage/bin/codacycoverage on line 4

Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/local/Cellar/php55/5.5.24/lib/php') in /Users/komnac/.composer/vendor/codacy/coverage/bin/codacycoverage on line 4

It is bad, because I don't want install codacycoverage for every project (some of them doesn't have composer). If my project on javascript, I don't want install javascript specific package, because I already have utility to send the Codacy results of code coverage (installed by composer).

There for using:

require 'vendor/autoload.php';

in https://github.com/codacy/php-codacy-coverage/blob/master/bin/codacycoverage#L4 wrong.

I know solution, that use something like this:

require_once __DIR__ . '/../../../autoload.php';

will be fix this problem.

Specify path to result file

Hello, everybody.

In my project I have a CI that use coverage files located in another place that codacycoverage (build/logs/clover.xml). I want to specify to codacycoverage a path to a file, that it should be use.

Could you add option, that have a specific path to result file (in clover mode) or a dir (in phpunit mode)?

For example:

php vendor/bin/codacycoverage clover /logs/cover/clover.xml
php vendor/bin/codcycoverage phpunit /log/cover/xml

If option not specified use a default path.

Hey Seems like we stopped receiving your coverage results. Check your CI server!

Issue

Coverage received successfully, but not displaying in Codacy

PHP Version

Tried it on 7 and 5.6

Operating System

Tried it on Mac and Linux

Expected Outcome

Coverage should display in the Codacy Dashboard and File page

Steps to reproduce the issue

Step 1 - Installed codacy/coverage (I preferred globally)

$ composer require global codacy/coverage

Step 2 - export token on terminal

$ export CODACY_PROJECT_TOKEN=<project_api_token>

image
Step 3 - Send clover xml file to Codacy

$ ~/.composer/vendor/bin/codacycoverage clover path/to/clover.xml -v

Actual Outcome

Terminal Output

image

Codacy Error's Message

image

folder vs. path (phpunit vs clover)

PHP Version

PHP 7.2.10-0ubuntu1 (cli) (built: Sep 13 2018 13:38:55) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10-0ubuntu1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.7.0beta2-dev, Copyright (c) 2002-2018, by Derick Rethans

Test framework

Codeception 2.5.3

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

Linux bookra 4.18.0-15-generic #16-Ubuntu SMP Thu Feb 7 10:56:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Actual Behavior

Running

./bin/codacycoverage clover ./tmp/coverage.xml

works (coverage.xml exists). Running

./bin/codacycoverage phpunit ./tmp/coverage.xml

throws error

In Parser.php line 50:                                                                               
  Unable to load the xml file. Make sure path is properly set. Using: "/home/  
  patrick/Projects/Booka/tmp/coverage.xml/index.xml"            

Expected

I would expect to have at least the same behaviour, EITHER filename OR directory. Otherwise the documentation (README.md) should state the difference.

Problems integrating php-codacy-coverage via travis / is file structure valid?

I've integrated codacy coverage into my existing PHP project.

The builds fail on Travis with:

3.99s$ travis_retry php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
                                                                                                                                                             
  [RuntimeException]                                                                                                                                         
  Could not scan for classes inside "/home/travis/build/ottlinger/hornherzogen/vendor/codacy/coverage/src/" which does not appear to be a file nor a folder  

upon build initialization.

Somehow the file structure does not seem to be valid for composer ....
https://travis-ci.org/ottlinger/hornherzogen/jobs/218432170

PHP Version

  • 7.0
  • 7.1

Test framework

  • PhpUnit 6.x
  • Composer: Composer version 1.4.1 2017-03-10 09:29:45

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

Use uname -a if on Linux.

Library Dependencies

If this is an issue that involves integration with another system, include the exact version and OS of the other system, including any intermediate drivers or APIs i.e. if you connect to a PostgreSQL database, include both the version / OS of PostgreSQL and the JDBC driver version used to connect to the database.

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

  • The builds should go through as they do locally.

Use phar in git repo is ugly

Hello, everybody.

Why are you store bin/phar/codacycoverage.phar in git repo? If I want modify some of files, I need regenerate this phar file. It's not hard, but really duplicate your code and seem ugly.

I don't know projects, that use phar like you. Many projects has phar.builder script, that can generate phar in they repo, but doesn't store phar.

Why I need download 21Kb (your phar size) unusefull traffic, when install dependency from composer?

I have looked your documentation for word phar (in this project and in http://docs.codacy.com) and have n't find any requirements or code example that use this phar.

Could you remove it from your repo?

Submitting empty phpunit report kills the script

Submitting a phpunit clover report from Travis CI with no unit tests will kill the script.

PHP Warning: Division by zero in /home/travis/build/bblue/ruby/vendor/codacy/coverage/src/Codacy/Coverage/Parser/CloverParser.php on line 28

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.