Skip to content

Remove dependency on Coveralls #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pbrisbin opened this issue Jul 2, 2014 · 6 comments
Closed

Remove dependency on Coveralls #6

pbrisbin opened this issue Jul 2, 2014 · 6 comments

Comments

@pbrisbin
Copy link
Contributor

pbrisbin commented Jul 2, 2014

We rely on classes from satooshi/php-coveralls for converting Clover XML to the proper JSON payload for our API endpoint. It would be good to just (re)write the logic we do rely on and remove that dependency.

Example Input:

<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1365848893">
  <project timestamp="1365848893">
    <package name="Hoge">
      <file name="/home/patrick/Code/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/ApiClient.php">
        <class name="TestFile" namespace="Hoge">
          <metrics methods="1" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="1" coveredstatements="0" elements="2" coveredelements="0"/>
        </class>
        <line num="6" type="method" name="__construct" crap="1" count="0"/>
        <line num="8" type="stmt" count="0"/>
      </file>
    </package>
  </project>
</coverage>

The API endpoint for reporting coverage is shared across all test reporters for all languages, so this format must be maintained.

Example Output:

{
  "partial": false,
  "run_at": 1365848893,
  "repo_token": "...",
  "environment": {
    "pwd": "\/home\/patrick\/Code\/codeclimate\/php-test-reporter",
    "package_version": "0.1.0-dev"
  },
  "git":{
    "head": "7e3f3495218f92ad5ce847248e306f279b11a9f9",
    "branch": "pb-bundled-cert",
    "committed_at": 1404230153
  },
  "ci_service": "travis",
  "source_files": [{
    "name": "src\/CodeClimate\/Bundle\/TestReporterBundle\/ApiClient.php",
    "blob_id": "272fdc7fbbcd2d99f99db2f4fa59747ed2f35b05",
    "coverage":"[null, 0, null, 1, null, 3, null, 0, ...]"
  },{ 
    // ...
  }]
}

Values in JSON not from XML:

  • Environment information (CWD, token, CI service, etc)
  • Git information (head, branch, blob ids, etc)
@elazar
Copy link

elazar commented Jan 13, 2015

This would seem prudent particularly because php-coveralls recently relaxed their Symfony dependency versions and those Symfony dependencies recently updated their minimum PHP version to 5.5.9, which exceeds this repository's current requirement of 5.3:

Related: I've filed an issue with php-coveralls regarding this.

@Ocramius
Copy link

@elazar that doesn't enforce usage of 5.5, no? 2.* versions of the symfony components should work fine.

@elazar
Copy link

elazar commented Jan 13, 2015

@Ocramius They should, but are not what's being used at this point unless the project using them explicitly sets differing versions. Here's an example of what I mean. /cc @chrismou

@elazar
Copy link

elazar commented Jan 13, 2015

Adding these to this repository's composer.json file should mitigate the issue described in my original comment (by providing the version upper bound that php-coveralls has removed) until the dependency on php-coveralls can be removed:

{
    "require": {
        "symfony/console": "~2",
        "symfony/yaml": "~2",
        "symfony/config": "~2",
        "symfony/stopwatch": "~2"
    }
}

@dblandin
Copy link
Contributor

@pbrisbin Is this still a concern?

@dblandin
Copy link
Contributor

Going to go ahead and close this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants