Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
fb2d9035
Commit
fb2d9035
authored
Jul 01, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include background migrations in the migration test level
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
db775720
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
.gitlab/ci/rules.gitlab-ci.yml
.gitlab/ci/rules.gitlab-ci.yml
+2
-2
lib/quality/test_level.rb
lib/quality/test_level.rb
+8
-0
spec/lib/quality/test_level_spec.rb
spec/lib/quality/test_level_spec.rb
+2
-2
No files found.
.gitlab/ci/rules.gitlab-ci.yml
View file @
fb2d9035
...
@@ -118,8 +118,8 @@
...
@@ -118,8 +118,8 @@
-
"
{,ee/}spec/**/*.rb"
-
"
{,ee/}spec/**/*.rb"
.db-patterns
:
&db-patterns
.db-patterns
:
&db-patterns
-
"
{,ee/}{
db
}/**/*"
-
"
{,ee/}{
,spec/}{db,migrations
}/**/*"
-
"
{,ee
}/spec/{db,migrations}
/**/*"
-
"
{,ee
/}{,spec/}lib/{,ee/}gitlab/background_migration
/**/*"
.backstage-patterns
:
&backstage-patterns
.backstage-patterns
:
&backstage-patterns
-
"
Dangerfile"
-
"
Dangerfile"
...
...
lib/quality/test_level.rb
View file @
fb2d9035
...
@@ -93,8 +93,14 @@ module Quality
...
@@ -93,8 +93,14 @@ module Quality
private
private
def
migration_and_background_migration_folders
TEST_LEVEL_FOLDERS
.
fetch
(
:migration
)
+
TEST_LEVEL_FOLDERS
.
fetch
(
:background_migration
)
end
def
folders_pattern
(
level
)
def
folders_pattern
(
level
)
case
level
case
level
when
:migration
"{
#{
migration_and_background_migration_folders
.
join
(
','
)
}
}"
# Geo specs aren't in a specific folder, but they all have the :geo tag, so we must search for them globally
# Geo specs aren't in a specific folder, but they all have the :geo tag, so we must search for them globally
when
:all
,
:geo
when
:all
,
:geo
'**'
'**'
...
@@ -105,6 +111,8 @@ module Quality
...
@@ -105,6 +111,8 @@ module Quality
def
folders_regex
(
level
)
def
folders_regex
(
level
)
case
level
case
level
when
:migration
"(
#{
migration_and_background_migration_folders
.
join
(
'|'
)
}
)"
# Geo specs aren't in a specific folder, but they all have the :geo tag, so we must search for them globally
# Geo specs aren't in a specific folder, but they all have the :geo tag, so we must search for them globally
when
:all
,
:geo
when
:all
,
:geo
''
''
...
...
spec/lib/quality/test_level_spec.rb
View file @
fb2d9035
...
@@ -28,7 +28,7 @@ RSpec.describe Quality::TestLevel do
...
@@ -28,7 +28,7 @@ RSpec.describe Quality::TestLevel do
context
'when level is migration'
do
context
'when level is migration'
do
it
'returns a pattern'
do
it
'returns a pattern'
do
expect
(
subject
.
pattern
(
:migration
))
expect
(
subject
.
pattern
(
:migration
))
.
to
eq
(
"spec/{migrations}{,/**/}*_spec.rb"
)
.
to
eq
(
"spec/{migrations
,lib/gitlab/background_migration,lib/ee/gitlab/background_migration
}{,/**/}*_spec.rb"
)
end
end
end
end
...
@@ -96,7 +96,7 @@ RSpec.describe Quality::TestLevel do
...
@@ -96,7 +96,7 @@ RSpec.describe Quality::TestLevel do
context
'when level is migration'
do
context
'when level is migration'
do
it
'returns a regexp'
do
it
'returns a regexp'
do
expect
(
subject
.
regexp
(
:migration
))
expect
(
subject
.
regexp
(
:migration
))
.
to
eq
(
%r{spec/(migrations)}
)
.
to
eq
(
%r{spec/(migrations
|lib/gitlab/background_migration|lib/ee/gitlab/background_migration
)}
)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment