GithubHelp home page GithubHelp logo

fastlane-plugin-codecov_reporter's People

Contributors

binarybeard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fastlane-plugin-codecov_reporter's Issues

Failure to remove *.coverage.txt

Overview

I am receiving the error rm: *.coverage.txt: No such file or directory after the codecov_reporter has already sent my code coverage to CodeCov.

The Issue

The issues lies with the following line:

The Solution

Essentially what is happening is the script is attempting to delete a file that may not exist. I fixed this issue by checking to see if the file exists; and if it does, I delete the file. I think this is a better practice.

fileExists = `[ -e *.coverage.txt ] && echo "1" || echo "0"`
  
if fileExists.to_i == 1
   UI.message 'Removing the created coverage.txt files'
   sh "rm *.coverage.txt"
end

I have submitted a pull request that fixes the issue: #3

Error Log

Attached is the error log:

[01:08:22]: ------------------------------
[01:08:22]: --- Step: codecov_reporter ---
[01:08:22]: ------------------------------
[01:08:22]: I am Getting the latest bash script from Codecov.io
[01:08:22]: $ curl -s -N https://Codecov.io/bash > /Users/travis/build/RudyB/Tempo/codecov_reporter.sh
[01:08:22]: It looks like I'm working with a private repository
[01:08:22]: $ bash /Users/travis/build/RudyB/Tempo/codecov_reporter.sh -K -t $CODECOV_TOKEN
[01:08:22]: ▸ _____          _
[01:08:22]: ▸ / ____|        | |
[01:08:22]: ▸ | |     ___   __| | ___  ___ _____   __
[01:08:22]: ▸ | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
[01:08:22]: ▸ | |___| (_) | (_| |  __/ (_| (_) \ V /
[01:08:22]: ▸ \_____\___/ \__,_|\___|\___\___/ \_/
[01:08:22]: ▸ Bash-8b76995
[01:08:22]: ▸ ==> Travis CI detected.
[01:08:22]: ▸ project root: .
[01:08:22]: ▸ Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
[01:08:22]: ▸ ==> Processing Xcode plists
[01:08:22]: ▸ Found plist file at /Users/travis/Library/Developer/Xcode/DerivedData/Tempo-ezxuornhiperdhcfhgltohrterqs/Logs/Test/29B598ED-7D71-4A88-AF30-E938F30B9066.xccoverage
[01:08:23]: ▸ ==> Running gcov in . (disable via -X gcov)
[01:08:23]: ▸ ==> Python coveragepy not found
[01:08:23]: ▸ ==> Searching for coverage reports in:
[01:08:23]: ▸ + .
[01:08:23]: ▸ -> Found 1 reports
[01:08:23]: ▸ ==> Detecting git/mercurial file structure
[01:08:23]: ▸ ==> Appending build variables
[01:08:23]: ▸ + TRAVIS_OS_NAME
[01:08:23]: ▸ + TRAVIS_RUBY_VERSION
[01:08:24]: ▸ ==> Reading reports
[01:08:24]: ▸ + ./29B598ED-7D71-4A88-AF30-E938F30B9066.xccoverage.plist bytes=11491182
[01:08:24]: ▸ ==> Appending adjustments
[01:08:24]: ▸ http://docs.codecov.io/docs/fixing-reports
[01:08:24]: ▸ + Found adjustments
[01:08:24]: ▸ ==> Gzipping contents
[01:08:25]: ▸ ==> Uploading reports
[01:08:25]: ▸ url: https://codecov.io
[01:08:25]: ▸ query: branch=develop&commit=fe61f7d92a37f64d286b50eee537cde56097b69f&build=111.1&build_url=&name=&tag=&slug=RudyB%2FTempo&service=travis&flags=&pr=false&job=110762372
[01:08:25]: ▸ -> Pinging Codecov
[01:08:25]: ▸ -> Uploading
[01:08:26]: ▸ -> View reports at https://codecov.io/github/RudyB/Tempo/commit/fe61f7d92a37f64d286b50eee537cde56097b69f
[01:08:26]: Removing the bash script I got from Codecov.io
[01:08:26]: $ rm /Users/travis/build/RudyB/Tempo/codecov_reporter.sh
[01:08:26]: Removing the created coverage.txt files
[01:08:26]: $ rm *.coverage.txt
[01:08:26]: ▸ rm: *.coverage.txt: No such file or directory
+----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                                       Lane Context                                                                                       |
+----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| DEFAULT_PLATFORM           | ios                                                                                                                                                         |
| ORIGINAL_DEFAULT_KEYCHAIN  | "/Users/travis/Library/Keychains/login.keychain-db"                                                                                                         |
| PLATFORM_NAME              | ios                                                                                                                                                         |
| LANE_NAME                  | ios tests                                                                                                                                                   |
| SCAN_DERIVED_DATA_PATH     | /Users/travis/Library/Developer/Xcode/DerivedData/Tempo-ezxuornhiperdhcfhgltohrterqs                                                                        |
| SCAN_GENERATED_PLIST_FILES | ["/Users/travis/Library/Developer/Xcode/DerivedData/Tempo-ezxuornhiperdhcfhgltohrterqs/Logs/Test/29B598ED-7D71-4A88-AF30-E938F30B9066_TestSummaries.plist"] |
| SCAN_GENERATED_PLIST_FILE  | /Users/travis/Library/Developer/Xcode/DerivedData/Tempo-ezxuornhiperdhcfhgltohrterqs/Logs/Test/29B598ED-7D71-4A88-AF30-E938F30B9066_TestSummaries.plist     |
+----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
[01:08:27]: Exit status of command 'rm *.coverage.txt' was 1 instead of 0.
rm: *.coverage.txt: No such file or directory
+------+------------------+-------------+
|           fastlane summary            |
+------+------------------+-------------+
| Step | Action           | Time (in s) |
+------+------------------+-------------+
| 1    | default_platform | 0           |
| 2    | setup_travis     | 0           |
| 3    | cocoapods        | 74          |
| 4    | run_tests        | 210         |
| 5    | slather          | 4           |
| 💥   | codecov_reporter | 4           |
+------+------------------+-------------+
[01:08:27]: fastlane finished with errors
Looking for related GitHub issues on fastlane/fastlane...
➡️  Improve Beta Setup
    https://github.com/fastlane/fastlane/pull/1 [closed] 1 💬
    04 Feb 2017
🔗  You can ⌘ + double-click on links to open them directly in your browser.
/Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane_core/lib/fastlane_core/ui/interface.rb:145:in `shell_error!': [!] Exit status of command 'rm *.coverage.txt' was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
rm: *.coverage.txt: No such file or directory
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane_core/lib/fastlane_core/ui/ui.rb:16:in `method_missing'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-plugin-codecov_reporter-0.1.1/lib/fastlane/plugin/codecov_reporter/actions/codecov_reporter_action.rb:21:in `run'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/runner.rb:256:in `block (2 levels) in execute_action'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/runner.rb:235:in `block in execute_action'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/runner.rb:230:in `chdir'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/runner.rb:230:in `execute_action'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/fast_file.rb:148:in `method_missing'
	from Fastfile:109:in `block (2 levels) in parsing_binding'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/commander-fastlane-4.4.5/lib/commander/command.rb:178:in `call'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/commander-fastlane-4.4.5/lib/commander/command.rb:153:in `run'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/commander-fastlane-4.4.5/lib/commander/runner.rb:476:in `run_active_command'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:75:in `run!'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/commander-fastlane-4.4.5/lib/commander/delegates.rb:15:in `run!'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/commands_generator.rb:337:in `run'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/commands_generator.rb:42:in `start'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/fastlane/lib/fastlane/cli_tools_distributor.rb:98:in `take_off'
	from /Users/travis/.rvm/gems/ruby-2.4.2/gems/fastlane-2.81.0/bin/fastlane:20:in `<top (required)>'
	from /Users/travis/.rvm/gems/ruby-2.4.2/bin/fastlane:23:in `load'
	from /Users/travis/.rvm/gems/ruby-2.4.2/bin/fastlane:23:in `<main>'
	from /Users/travis/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `eval'
	from /Users/travis/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `<main>'

codecov_reporter.sh left if action fails

If the codecov_reporter fastlane plugin fails it leaves behind a new file codecov_reporter.sh and this would subsequently fail any ensure_git_status_clean fastlane commands.

codecov_reporter should ensure it cleans up after itself for both happy path (success case) and error case including any generated reports that failed to upload.

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.