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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
5016efe4
Commit
5016efe4
authored
Mar 14, 2019
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove factories from MigrateOldArtifacts spec
parent
329d3e12
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
spec/migrations/migrate_old_artifacts_spec.rb
spec/migrations/migrate_old_artifacts_spec.rb
+19
-13
No files found.
spec/migrations/migrate_old_artifacts_spec.rb
View file @
5016efe4
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
require
'spec_helper'
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170523083112_migrate_old_artifacts.rb'
)
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170523083112_migrate_old_artifacts.rb'
)
describe
MigrateOldArtifacts
do
# Adding the ci_job_artifacts table (from the 20170918072948 schema)
# makes the use of model code below easier.
describe
MigrateOldArtifacts
,
:migration
,
schema:
20170918072948
do
let
(
:migration
)
{
described_class
.
new
}
let
(
:migration
)
{
described_class
.
new
}
let!
(
:directory
)
{
Dir
.
mktmpdir
}
let!
(
:directory
)
{
Dir
.
mktmpdir
}
...
@@ -16,18 +18,22 @@ describe MigrateOldArtifacts do
...
@@ -16,18 +18,22 @@ describe MigrateOldArtifacts do
end
end
context
'with migratable data'
do
context
'with migratable data'
do
set
(
:project1
)
{
create
(
:project
,
ci_id:
2
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let
(
:projects
)
{
table
(
:projects
)
}
set
(
:project2
)
{
create
(
:project
,
ci_id:
3
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let
(
:ci_pipelines
)
{
table
(
:ci_pipelines
)
}
set
(
:project3
)
{
create
(
:project
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let
(
:ci_builds
)
{
table
(
:ci_builds
)
}
set
(
:pipeline1
)
{
create
(
:ci_empty_pipeline
,
project:
project1
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:project1
)
{
projects
.
create!
(
ci_id:
2
)
}
set
(
:pipeline2
)
{
create
(
:ci_empty_pipeline
,
project:
project2
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:project2
)
{
projects
.
create!
(
ci_id:
3
)
}
set
(
:pipeline3
)
{
create
(
:ci_empty_pipeline
,
project:
project3
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:project3
)
{
projects
.
create!
}
let!
(
:build_with_legacy_artifacts
)
{
create
(
:ci_build
,
pipeline:
pipeline1
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:pipeline1
)
{
ci_pipelines
.
create!
(
project_id:
project1
.
id
)
}
let!
(
:build_without_artifacts
)
{
create
(
:ci_build
,
pipeline:
pipeline1
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:pipeline2
)
{
ci_pipelines
.
create!
(
project_id:
project2
.
id
)
}
let!
(
:build2
)
{
create
(
:ci_build
,
pipeline:
pipeline2
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:pipeline3
)
{
ci_pipelines
.
create!
(
project_id:
project3
.
id
)
}
let!
(
:build3
)
{
create
(
:ci_build
,
pipeline:
pipeline3
)
}
# rubocop:disable RSpec/FactoriesInMigrationSpecs
let!
(
:build_with_legacy_artifacts
)
{
ci_builds
.
create!
(
commit_id:
pipeline1
.
id
,
project_id:
project1
.
id
,
type:
'Ci::Build'
).
becomes
(
Ci
::
Build
)
}
let!
(
:build_without_artifacts
)
{
ci_builds
.
create!
(
commit_id:
pipeline1
.
id
,
project_id:
project1
.
id
,
type:
'Ci::Build'
).
becomes
(
Ci
::
Build
)
}
let!
(
:build2
)
{
ci_builds
.
create!
(
commit_id:
pipeline2
.
id
,
project_id:
project2
.
id
,
type:
'Ci::Build'
).
becomes
(
Ci
::
Build
)
}
let!
(
:build3
)
{
ci_builds
.
create!
(
commit_id:
pipeline3
.
id
,
project_id:
project3
.
id
,
type:
'Ci::Build'
).
becomes
(
Ci
::
Build
)
}
before
do
before
do
setup_builds
(
build2
,
build3
)
setup_builds
(
build2
,
build3
)
...
...
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