Skip to content
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

Remove duplicate coverage files, favoring the file with higher coverage. #16

Merged
merged 4 commits into from
Jul 2, 2014

Conversation

ayanonagon
Copy link
Contributor

Fixes #13

⚠️ Another thorough code-review for this Ruby n00b please. I kind of feel dirty using each for dedupe (instead of something more slick like map or uniq) but I don't know of a nicer way of doing this de-duplication. 🐙

@ayanonagon ayanonagon changed the title Remove duplicate coverage files, favoring the file with high coverage. Remove duplicate coverage files, favoring the file with higher coverage. Jul 2, 2014
pathname = coverage_file.source_file_pathname
duplicate = coverage_files_dict[pathname]
if duplicate
duplicate_coverage = duplicate.percentage_lines_tested
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I don't really need this variable or the one on the next line.

@ayanonagon ayanonagon closed this Jul 2, 2014
@ayanonagon ayanonagon reopened this Jul 2, 2014
marklarr added a commit that referenced this pull request Jul 2, 2014
Remove duplicate coverage files, favoring the file with higher coverage.
@marklarr marklarr merged commit 52503e7 into master Jul 2, 2014
@marklarr
Copy link
Contributor

marklarr commented Jul 2, 2014

🌳

@ayanonagon ayanonagon deleted the ayanonagon/dedupe branch August 3, 2014 18:41
pietbrauer pushed a commit to nerdishbynature/slather that referenced this pull request Jan 11, 2016
…-param

Fix spec when running in a CI environment
jkrumow pushed a commit that referenced this pull request Jan 19, 2016
commit 6a19585
Merge: 36db604 edc92c4
Author: Simone Civetta <[email protected]>
Date:   Mon Jan 18 18:11:39 2016 +0100

    Merge pull request #17 from viteinfinite/feature-profdata-flavoured-specs

    Update specs to test against profdata output instead of gcov

commit edc92c4
Author: Simone Civetta <[email protected]>
Date:   Mon Jan 18 17:55:45 2016 +0100

    [specs] Update specs to test against profdata output instead of gcov

commit c460c4f
Author: Simone Civetta <[email protected]>
Date:   Mon Jan 18 17:52:16 2016 +0100

    [profdata] Add specs for ignoring platform files

commit ab7004c
Author: Simone Civetta <[email protected]>
Date:   Mon Jan 18 17:16:25 2016 +0100

    [command] Add spec for verbose mode

commit 2930bef
Author: Simone Civetta <[email protected]>
Date:   Mon Jan 18 17:08:31 2016 +0100

    [profdata] Ignore platform files

commit 3442a20
Author: Simone Civetta <[email protected]>
Date:   Mon Jan 18 15:48:05 2016 +0100

    [command] Add verbose mode

commit 36db604
Merge: 1408a73 5d555fe
Author: Simone Civetta <[email protected]>
Date:   Sun Dec 27 03:05:53 2015 +0100

    Merge pull request #16 from viteinfinite/feature-binaryfile-param

    Fix spec when running in a CI environment

commit 5d555fe
Author: Simone Civetta <[email protected]>
Date:   Sun Dec 27 03:03:58 2015 +0100

    [coveralls] Fix spec when running in a CI environment

commit 1408a73
Merge: 19cd964 1e40d93
Author: Simone Civetta <[email protected]>
Date:   Sun Dec 27 02:43:46 2015 +0100

    Merge pull request #15 from viteinfinite/feature-binaryfile-param

    Add binary_file param

commit 1e40d93
Author: Simone Civetta <[email protected]>
Date:   Sun Dec 27 01:42:17 2015 +0100

    [project] Refactor configuration method names

commit 2c43d91
Author: Simone Civetta <[email protected]>
Date:   Sun Dec 27 01:36:06 2015 +0100

    [project] Refactor configuration steps

commit 6a16699
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 24 02:16:58 2015 +0100

    [profdata] Add binary file param

commit 19cd964
Merge: e8b7e21 5343de6
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 17 22:31:49 2015 +0100

    Merge pull request #14 from viteinfinite/fix-macos-binary

    [specs] Fix MacOS binary file spec

commit 5343de6
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 17 22:30:36 2015 +0100

    [specs] Fix MacOS binary file spec

commit e8b7e21
Merge: ad9b9eb aab3a15
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 17 22:09:23 2015 +0100

    Merge pull request #13 from viteinfinite/fix-macos-binary

    Fix MacOS binary file detection

commit aab3a15
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 17 22:08:08 2015 +0100

    [profdata] Fix binary file detection for MacOS apps

commit ad9b9eb
Merge: 57c8850 c05b0c0
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 17 15:44:00 2015 +0100

    Merge pull request #12 from viteinfinite/feature-re-encode-develop

    Re-encode llvm-cov output to prevent potential "invalid byte sequence" issue

commit c05b0c0
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 17 15:40:37 2015 +0100

    [profdata] Re-encode llvm-cov output to prevent potential "invalid byte sequence" issue

commit 57c8850
Author: Simone Civetta <[email protected]>
Date:   Tue Dec 15 16:27:02 2015 +0100

    [command] Print environment info for easier debugging

commit c01bca0
Author: Simone Civetta <[email protected]>
Date:   Tue Dec 15 15:32:05 2015 +0100

    [profdata] Exclude UITest runner analysis

commit a55a142
Author: Simone Civetta <[email protected]>
Date:   Tue Dec 15 03:35:08 2015 +0100

    [spec] Fix path being absolute in HTML fixture

commit 1c5baad
Author: Simone Civetta <[email protected]>
Date:   Tue Dec 15 03:22:15 2015 +0100

    [spec] De-ignore fixture

commit 8158b5c
Author: Simone Civetta <[email protected]>
Date:   Tue Dec 15 02:50:56 2015 +0100

    [project] Minor refactoring for easier troubleshooting and readability

commit 173e822
Author: Simone Civetta <[email protected]>
Date:   Mon Dec 14 23:16:49 2015 +0100

    [html] Add working profdata support

commit 644db09
Author: Simone Civetta <[email protected]>
Date:   Mon Dec 14 18:06:37 2015 +0100

    [project] Are more explicit error when the build_directory does not exist

commit e909c76
Author: Simone Civetta <[email protected]>
Date:   Mon Dec 14 16:47:27 2015 +0100

    [command] Improve command clarity

commit 9b9bc7c
Merge: 0b86c80 37ae46c
Author: Simone Civetta <[email protected]>
Date:   Sun Dec 13 23:36:48 2015 +0100

    Merge pull request #10 from viteinfinite/feature-temp-profdata

    Merge with master

commit 37ae46c
Author: Simone Civetta <[email protected]>
Date:   Sun Dec 13 23:23:54 2015 +0100

    [profdata] Improve coveralls spec

commit f8fd63d
Merge: 84c54a9 87899db
Author: Simone Civetta <[email protected]>
Date:   Fri Dec 11 02:42:09 2015 +0100

    Merge branch 'venmo-master' into feature-temp-profdata

    Conflicts:
    	slather.gemspec

commit 0b86c80
Merge: 61f0098 84c54a9
Author: Simone Civetta <[email protected]>
Date:   Fri Dec 11 02:37:29 2015 +0100

    Merge branch 'feature-temp-profdata' into feature-profdata

commit 84c54a9
Merge: 0660a07 61f0098
Author: Simone Civetta <[email protected]>
Date:   Fri Dec 11 02:37:16 2015 +0100

    Merge remote-tracking branch 'origin/feature-profdata' into feature-temp-profdata

    # Conflicts:
    #	lib/slather/project.rb
    #	spec/fixtures/cobertura.xml
    #	spec/fixtures/gutter.json
    #	spec/slather/coverage_service/coveralls_spec.rb
    #	spec/slather/project_spec.rb
    #	spec/spec_helper.rb

commit 0660a07
Author: Simone Civetta <[email protected]>
Date:   Fri Dec 11 02:09:12 2015 +0100

    [profdata] Improve project setup specs

commit 341c9b9
Author: Simone Civetta <[email protected]>
Date:   Fri Dec 11 01:24:09 2015 +0100

    [profdata] Fix xctest bundle spec

commit f361648
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 20:56:41 2015 +0100

    [profdata] Fix binary file detection when testing static libraries

commit ef9f6d0
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 19:44:49 2015 +0100

    [specs] Fix build_directory test

commit adae9f5
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 18:32:45 2015 +0100

    [profdata] Rename derived_data_dir to derived_data_path

commit b92f9b1
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 18:26:54 2015 +0100

    [project] Fix typo

commit 3dd3558
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 18:25:12 2015 +0100

    [profdata] Add profdata fixtures

commit 5c96f14
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 17:36:05 2015 +0100

    [helper] Set a fixed DerivedData dir for better testing

commit 3ec9e2e
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 17:34:24 2015 +0100

    [xcode7] Make fixtures comply to Xcode7 gcov output

commit 2479d59
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 15:54:02 2015 +0100

    [xcode7] Make specs less precise in order to conform to Xcode 7 gcov bug

commit 0dec11e
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 14:51:46 2015 +0100

    [helper] Set a fixed DerivedData dir for better testing

commit ccc88e5
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 14:51:04 2015 +0100

    [profdata] Rename derived_data_dir to derived_data_path

commit 342ff7b
Author: Simone Civetta <[email protected]>
Date:   Thu Dec 10 13:56:15 2015 +0100

    [profdata] Update cocoa pods and xcodeproj dependencies

commit d09ce4f
Author: Matt Delves <[email protected]>
Date:   Wed Sep 23 11:58:48 2015 +1000

    [profdata] update cocoapods and xcodeproj dependencies

commit f231c8b
Author: Matt Delves <[email protected]>
Date:   Wed Sep 23 11:11:02 2015 +1000

    [profdata] Use xcode7 on travisCI

commit 5a101fb
Author: Matt Delves <[email protected]>
Date:   Wed Sep 23 11:02:09 2015 +1000

    [profdata] update spec usage to expect instead of should

commit 0bb51de
Author: Matt Delves <[email protected]>
Date:   Wed Sep 23 10:56:49 2015 +1000

    [profdata] Ignore gcda and gcno files

commit 5c971d3
Author: Matt Delves <[email protected]>
Date:   Wed Sep 23 10:55:49 2015 +1000

    [profdata] Update rspec to 3.3

commit 510b60c
Merge: 8aa1c12 b8997fe
Author: Matt Delves <[email protected]>
Date:   Wed Sep 23 08:21:26 2015 +1000

    Merge pull request #1 from AliSoftware/feature-profdata

    Fixes for your profdata support

commit b8997fe
Author: Olivier Halligon <[email protected]>
Date:   Tue Sep 22 21:25:59 2015 +0200

    Using xcrun to find llvm-cov (instead of building the path ourselves)

commit ef91356
Author: Olivier Halligon <[email protected]>
Date:   Tue Sep 22 21:23:56 2015 +0200

    Adding "rake spec" task to Rakefile

commit 9289c96
Author: Olivier Halligon <[email protected]>
Date:   Tue Sep 22 21:19:11 2015 +0200

    Introducing coverage format auto-detection based on Xcode version

    * Change "--input-format" option of "slather setup" to "--format", more appropriate name in the context of setup
    * Supporting auto for `slather setup --format` and `slather coverage --input-format` which will use profdata if Xcode 7, gcov if earlier
    * Checking the validity of the parameters given to `--format` / `--input-format`

commit 8b7a535
Author: Olivier Halligon <[email protected]>
Date:   Tue Sep 22 01:41:52 2015 +0200

    Prepare the code to auto-update xcschemes with "slather setup".

    This will need us to update the dependency against the xcodeproj gem to "~> 0.27" (which requires to bump the dependency on cocoapods as well)

commit d079453
Author: Olivier Halligon <[email protected]>
Date:   Tue Sep 22 00:47:04 2015 +0200

    Add "--input-format" parameter in "slather setup" too, so it can enable CLANG_ENABLE_CODE_COVERAGE instead of GCC_GENERATE_TEST_COVERAGE_FILES

    + Print explicit error when missing parameter for "slather setup"

    TODO: improve Xcodeproj gem so my new Xcodeproj::XCScheme implementation also allows to set codeCoverageEnabled = YES in every xcscheme

commit 4d0199a
Author: Olivier Halligon <[email protected]>
Date:   Tue Sep 22 00:44:28 2015 +0200

    Fix shell escape of llvm-cov path and arguments

commit 8aa1c12
Author: Simone Civetta <[email protected]>
Date:   Mon Aug 10 18:49:59 2015 +0200

    Add spec for framework coverage

commit e64a7b7
Author: Pierre-Marc Airoldi <[email protected]>
Date:   Sat Aug 8 14:39:41 2015 -0400

    fix llvm-cov path and add framework coverage

commit 95a067b
Author: Simone Civetta <[email protected]>
Date:   Fri Jul 10 20:54:53 2015 +0200

    Fix whitespace issues

commit 7f602d0
Author: Simone Civetta <[email protected]>
Date:   Sun Jun 21 12:10:29 2015 +0200

    Merge branch 'feature-temp-profdata' of https://github.com/viteinfinite/slather into feature-temp-profdata

    * 'feature-temp-profdata' of https://github.com/viteinfinite/slather:
      Remove useless file
      Fix tests
      Remove useless files
      Fix unit tests
      Add more precise path handling
      Add scheme and ignore
      Export coverage base info into modules
      Fix coveralls_spec
      Minor fixes in spec_helper
      Re-add coveralls support
      Re-add coveralls support
      Add tests
      [WIP] Refactor interface of coverage_file
      [WIP] Add unit tests
      [WIP] Add experimental support to swift

commit 9aa2af2
Author: Anthony Mittaz <[email protected]>
Date:   Thu Jun 18 11:43:45 2015 +1000

    fix broken path

commit 5cd2399
Author: Simone Civetta <[email protected]>
Date:   Sat Jun 13 08:44:16 2015 -0700

    Add experimental support to profdata file format

commit 61f0098
Merge: 7236739 c5d2b70
Author: Simone Civetta <[email protected]>
Date:   Mon Aug 10 18:53:06 2015 +0200

    Merge branch 'petester42-master' into feature-profdata

    * petester42-master:
      Add spec for framework coverage
      Fix llvm-cov path and add framework coverage

commit c5d2b70
Author: Simone Civetta <[email protected]>
Date:   Mon Aug 10 18:49:59 2015 +0200

    Add spec for framework coverage

commit 9e5724b
Author: Pierre-Marc Airoldi <[email protected]>
Date:   Sat Aug 8 14:39:41 2015 -0400

    fix llvm-cov path and add framework coverage

commit 7236739
Merge: 32dab65 c70948f
Author: Simone Civetta <[email protected]>
Date:   Sun Jul 12 00:08:42 2015 +0200

    Merge pull request #3 from viteinfinite/fix-whitespaces

    Fix whitespace issues

commit c70948f
Author: Simone Civetta <[email protected]>
Date:   Fri Jul 10 20:54:53 2015 +0200

    Fix whitespace issues

commit 32dab65
Merge: d3bece9 8558508
Author: Simone Civetta <[email protected]>
Date:   Sun Jun 21 15:45:30 2015 +0200

    Add JSON support to profdata file format

commit 8558508
Merge: 1f58caa 0c7877a
Author: Simone Civetta <[email protected]>
Date:   Sun Jun 21 12:13:22 2015 +0200

    Merge pull request #2 from viteinfinite/feature-temp-profdata

    Add JSON support to profdata format

commit 0c7877a
Author: Simone Civetta <[email protected]>
Date:   Sun Jun 21 12:10:29 2015 +0200

    Merge branch 'feature-temp-profdata' of https://github.com/viteinfinite/slather into feature-temp-profdata

    * 'feature-temp-profdata' of https://github.com/viteinfinite/slather:
      Remove useless file
      Fix tests
      Remove useless files
      Fix unit tests
      Add more precise path handling
      Add scheme and ignore
      Export coverage base info into modules
      Fix coveralls_spec
      Minor fixes in spec_helper
      Re-add coveralls support
      Re-add coveralls support
      Add tests
      [WIP] Refactor interface of coverage_file
      [WIP] Add unit tests
      [WIP] Add experimental support to swift

commit d3bece9
Merge: b1de838 b305ed8
Author: Simone Civetta <[email protected]>
Date:   Thu Jun 18 20:03:08 2015 +0200

    Merge pull request #1 from sync/feature-profdata

    Fix broken path

commit b305ed8
Author: Anthony Mittaz <[email protected]>
Date:   Thu Jun 18 11:43:45 2015 +1000

    fix broken path

commit b1de838
Author: Simone Civetta <[email protected]>
Date:   Sat Jun 13 08:44:16 2015 -0700

    Add experimental support to profdata file format
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

Successfully merging this pull request may close these issues.

Have it work for projects with duplicate gcno files
2 participants