binarybeard / fastlane-plugin-codecov_reporter Goto Github PK
View Code? Open in Web Editor NEWFastlane plugin that uploads coverage reports to Codecov.io
License: MIT License
Fastlane plugin that uploads coverage reports to Codecov.io
License: MIT License
It would be great if codecov_reporter would prompt on stdout and read from stdin if CODECOV_TOKEN was not found in ENV like so many other password or token related fastlane tools currently do.
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 issues lies with the following line:
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
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>'
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.