This repository was archived by the owner on Nov 30, 2024. It is now read-only.
Ignore working directory when excluding system patterns.#1616
Merged
JonRowe merged 3 commits intoJul 16, 2014
Conversation
Member
Author
|
FYI I'm about to get on a flight to singapore for RDRC so won't reply to feedback till later. |
- The original spec had a double-slashed path like '/Code/gems//arbitrary'. - Stubbing `Dir.getwd` forced the implementation to use that, but we'd like to reuse `RSpec::Metadata.relative_path` which does not use `Dir.getwd` internally.
Member
|
@JonRowe -- I've revisited this and applied some further improvements to what you had before (see the commit messages for rationale). Thoughts? |
- doesnt_match_inclusion_pattern_unless_system_exclusion? has a double negative and was being used in a compound conditional, which made my head explode. I couldn't understand it at all. - Reuse `Metadata.relative_path` rather than having our own logic to do that. - It'll perform better to get the relative path once rather than doing it once per pattern in the `patterns.any?` block. - Add spec for case that is covered by a cucumber scenario but not by an existing spec (an earlier version of this commit broke that cucumber scenario but no specs failed, revealing the missing spec coverage).
Member
Author
|
Seems legit. |
JonRowe
added a commit
that referenced
this pull request
Jul 16, 2014
…g_directory Ignore working directory when excluding system patterns.
JonRowe
added a commit
that referenced
this pull request
Jul 16, 2014
…g_directory Ignore working directory when excluding system patterns.
Member
Author
|
Picked this to master too. |
myronmarston
added a commit
that referenced
this pull request
Sep 17, 2014
This also greatly simplifies the backtrace formatter; the system_exclusion_patterns approach made it more complicated, as did always having an inclusion_pattern. We only need the current directory as an inclusion_pattern when it matches one of the built-in exclusion patterns. Note that this was the approach that we originally had in #843; it got lost in the refactoring in #1062 (af0b271). While it seemed like a simpler approach to always put the current dir in the inclusion_patterns, in practice, this caused a sequence of whack-a-mole regressions: - #1328 (fixed by #1329) - #1604 (fixed by #1616) - #1705 (fixed by this commit) I'm hopeful that returning to only including the current dir in `inclusion_patterns` if it matches a built-in exclusion pattern will solve these issues once and for all.
myronmarston
added a commit
that referenced
this pull request
Sep 17, 2014
This also greatly simplifies the backtrace formatter; the system_exclusion_patterns approach made it more complicated, as did always having an inclusion_pattern. We only need the current directory as an inclusion_pattern when it matches one of the built-in exclusion patterns. Note that this was the approach that we originally had in #843; it got lost in the refactoring in #1062 (af0b271). While it seemed like a simpler approach to always put the current dir in the inclusion_patterns, in practice, this caused a sequence of whack-a-mole regressions: - #1328 (fixed by #1329) - #1604 (fixed by #1616) - #1705 (fixed by this commit) I'm hopeful that returning to only including the current dir in `inclusion_patterns` if it matches a built-in exclusion pattern will solve these issues once and for all.
myronmarston
added a commit
that referenced
this pull request
Sep 18, 2014
This also greatly simplifies the backtrace formatter; the system_exclusion_patterns approach made it more complicated, as did always having an inclusion_pattern. We only need the current directory as an inclusion_pattern when it matches one of the built-in exclusion patterns. Note that this was the approach that we originally had in #843; it got lost in the refactoring in #1062 (af0b271). While it seemed like a simpler approach to always put the current dir in the inclusion_patterns, in practice, this caused a sequence of whack-a-mole regressions: - #1328 (fixed by #1329) - #1604 (fixed by #1616) - #1705 (fixed by this commit) I'm hopeful that returning to only including the current dir in `inclusion_patterns` if it matches a built-in exclusion pattern will solve these issues once and for all.
MatheusRich
pushed a commit
to MatheusRich/rspec-core
that referenced
this pull request
Oct 30, 2020
…orking_directory Ignore working directory when excluding system patterns.
MatheusRich
pushed a commit
to MatheusRich/rspec-core
that referenced
this pull request
Oct 30, 2020
MatheusRich
pushed a commit
to MatheusRich/rspec-core
that referenced
this pull request
Oct 30, 2020
This also greatly simplifies the backtrace formatter; the system_exclusion_patterns approach made it more complicated, as did always having an inclusion_pattern. We only need the current directory as an inclusion_pattern when it matches one of the built-in exclusion patterns. Note that this was the approach that we originally had in rspec#843; it got lost in the refactoring in rspec#1062 (af0b271). While it seemed like a simpler approach to always put the current dir in the inclusion_patterns, in practice, this caused a sequence of whack-a-mole regressions: - rspec#1328 (fixed by rspec#1329) - rspec#1604 (fixed by rspec#1616) - rspec#1705 (fixed by this commit) I'm hopeful that returning to only including the current dir in `inclusion_patterns` if it matches a built-in exclusion pattern will solve these issues once and for all.
yujinakayama
pushed a commit
to yujinakayama/rspec-monorepo
that referenced
this pull request
Oct 6, 2021
…ion_priority_for_working_directory Ignore working directory when excluding system patterns. --- This commit was imported from rspec/rspec-core@b7548b3.
yujinakayama
pushed a commit
to yujinakayama/rspec-monorepo
that referenced
this pull request
Oct 6, 2021
This commit was imported from rspec/rspec-core@00370ab.
yujinakayama
pushed a commit
to yujinakayama/rspec-monorepo
that referenced
this pull request
Oct 6, 2021
This also greatly simplifies the backtrace formatter; the system_exclusion_patterns approach made it more complicated, as did always having an inclusion_pattern. We only need the current directory as an inclusion_pattern when it matches one of the built-in exclusion patterns. Note that this was the approach that we originally had in rspec/rspec-core#843; it got lost in the refactoring in rspec/rspec-core#1062 (af0b271c92ad2a3336eb70be7bf2c0de4325a568). While it seemed like a simpler approach to always put the current dir in the inclusion_patterns, in practice, this caused a sequence of whack-a-mole regressions: - rspec/rspec-core#1328 (fixed by rspec/rspec-core#1329) - rspec/rspec-core#1604 (fixed by rspec/rspec-core#1616) - rspec/rspec-core#1705 (fixed by this commit) I'm hopeful that returning to only including the current dir in `inclusion_patterns` if it matches a built-in exclusion pattern will solve these issues once and for all. --- This commit was imported from rspec/rspec-core@9f53daf.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1604 by removing working directory from excluded patterns.