schema_dev 3.13.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/prs.yml +49 -0
- data/.simplecov +20 -0
- data/Gemfile +2 -0
- data/README.md +12 -10
- data/Rakefile +3 -5
- data/bin/schema_dev +25 -21
- data/lib/schema_dev/config.rb +62 -44
- data/lib/schema_dev/executor.rb +9 -8
- data/lib/schema_dev/gem.rb +45 -37
- data/lib/schema_dev/gemfile_selector.rb +7 -7
- data/lib/schema_dev/gemfiles.rb +6 -5
- data/lib/schema_dev/github_actions.rb +266 -0
- data/lib/schema_dev/matrix_executor.rb +4 -2
- data/lib/schema_dev/readme.rb +17 -10
- data/lib/schema_dev/rspec/db.rb +44 -33
- data/lib/schema_dev/rspec.rb +4 -9
- data/lib/schema_dev/ruby_selector.rb +29 -14
- data/lib/schema_dev/runner.rb +14 -10
- data/lib/schema_dev/tasks/dbms.rb +34 -26
- data/lib/schema_dev/tasks.rb +2 -3
- data/lib/schema_dev/templates.rb +5 -5
- data/lib/schema_dev/version.rb +3 -1
- data/lib/schema_dev.rb +3 -1
- data/schema_dev.gemspec +24 -25
- data/spec/schema_dev/config_spec.rb +60 -0
- data/spec/schema_dev/gem_spec.rb +74 -0
- data/spec/schema_dev/gemfile_selector_spec.rb +11 -0
- data/spec/schema_dev/gemfiles_spec.rb +41 -0
- data/spec/schema_dev/github_actions_spec.rb +818 -0
- data/spec/schema_dev/runner_spec.rb +103 -0
- data/spec/spec_helper.rb +5 -6
- data/templates/README/uses.schema_dev.md.erb +1 -2
- data/templates/gem/GEM_NAME.gemspec.erb +15 -14
- data/templates/gem/Gemfile.erb +2 -0
- data/templates/gem/Gemfile.local.erb +2 -0
- data/templates/gem/README.md.erb +1 -2
- data/templates/gem/Rakefile.erb +2 -0
- data/templates/gem/schema_dev.yml.erb +5 -2
- data/templates/gem/simplecov.erb +20 -0
- data/templates/gemfiles/Gemfile.base.erb +1 -1
- data/templates/gemfiles/activerecord-5.2/Gemfile.base.erb +2 -1
- data/templates/gemfiles/activerecord-5.2/Gemfile.mysql2.erb +2 -2
- data/templates/gemfiles/activerecord-5.2/Gemfile.postgresql.erb +2 -2
- data/templates/gemfiles/activerecord-5.2/Gemfile.sqlite3.erb +3 -3
- data/templates/gemfiles/activerecord-6.0/Gemfile.base.erb +4 -0
- data/templates/gemfiles/activerecord-6.0/Gemfile.mysql2.erb +10 -0
- data/templates/gemfiles/activerecord-6.0/Gemfile.postgresql.erb +10 -0
- data/templates/gemfiles/{activerecord-3.2 → activerecord-6.0}/Gemfile.sqlite3.erb +2 -2
- data/templates/gemfiles/activerecord-6.1/Gemfile.base.erb +4 -0
- data/templates/gemfiles/activerecord-6.1/Gemfile.mysql2.erb +10 -0
- data/templates/gemfiles/activerecord-6.1/Gemfile.postgresql.erb +10 -0
- data/templates/gemfiles/{activerecord-4.0 → activerecord-6.1}/Gemfile.sqlite3.erb +2 -2
- metadata +56 -156
- data/.travis.yml +0 -4
- data/lib/schema_dev/tasks/coveralls.rb +0 -3
- data/lib/schema_dev/travis.rb +0 -118
- data/spec/config_spec.rb +0 -61
- data/spec/gem_spec.rb +0 -77
- data/spec/gemfile_sepector_spec.rb +0 -10
- data/spec/gemfiles_spec.rb +0 -43
- data/spec/runner_spec.rb +0 -106
- data/spec/travis_spec.rb +0 -298
- data/templates/gemfiles/activerecord-3.2/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-3.2/Gemfile.mysql.erb +0 -10
- data/templates/gemfiles/activerecord-3.2/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-3.2/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-4.0/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-4.0/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-4.0/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-4.1/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-4.1/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-4.1/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-4.1/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-4.2/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-4.2/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-4.2/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-4.2/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-4.2.0/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-4.2.0/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-4.2.0/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-4.2.0/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-4.2.1/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-4.2.1/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-4.2.1/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-4.2.1/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-4.2.6/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-4.2.6/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-4.2.6/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-4.2.6/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-5.0/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-5.0/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-5.0/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-5.0/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.0/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-5.0.0/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.0/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.0/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.1/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-5.0.1/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.1/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.1/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.2/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-5.0.2/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.2/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.2/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.3/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-5.0.3/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.3/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-5.0.3/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-5.1/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-5.1/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-5.1/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-5.1/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-5.1.0/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-5.1.0/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-5.1.0/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-5.1.0/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-5.1.1/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-5.1.1/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-5.1.1/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-5.1.1/Gemfile.sqlite3.erb +0 -10
- data/templates/gemfiles/activerecord-edge/Gemfile.base.erb +0 -3
- data/templates/gemfiles/activerecord-edge/Gemfile.mysql2.erb +0 -10
- data/templates/gemfiles/activerecord-edge/Gemfile.postgresql.erb +0 -10
- data/templates/gemfiles/activerecord-edge/Gemfile.sqlite3.erb +0 -10
data/spec/runner_spec.rb
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
require 'schema_dev/runner'
|
|
2
|
-
require 'which_works'
|
|
3
|
-
require 'pathname'
|
|
4
|
-
|
|
5
|
-
describe SchemaDev::Runner do
|
|
6
|
-
|
|
7
|
-
it "creates gemfiles" do
|
|
8
|
-
config = get_config(ruby: "2.1.3", activerecord: "4.0", db: "sqlite3")
|
|
9
|
-
runner = SchemaDev::Runner.new(config)
|
|
10
|
-
in_tmpdir do
|
|
11
|
-
expect{ runner.gemfiles }.to output("* Updated gemfiles\n").to_stdout
|
|
12
|
-
expect(Pathname.new("gemfiles")).to be_directory
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it "creates travis" do
|
|
17
|
-
config = get_config(ruby: "2.1.3", activerecord: "4.0", db: "sqlite3")
|
|
18
|
-
runner = SchemaDev::Runner.new(config)
|
|
19
|
-
in_tmpdir do
|
|
20
|
-
expect{ runner.travis }.to output("* Updated .travis.yml\n").to_stdout
|
|
21
|
-
expect(Pathname.new(".travis.yml")).to be_file
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
Selectors = {
|
|
26
|
-
'chruby-exec' => "SHELL=/usr/local/bin/bash chruby-exec ruby-#{RUBY_VERSION} --",
|
|
27
|
-
'rvm' => "rvm #{RUBY_VERSION} do",
|
|
28
|
-
'rbenv' => "RBENV_VERSION=#{RUBY_VERSION}"
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
Selectors.each do |selector, selection_command|
|
|
32
|
-
|
|
33
|
-
describe "matrix (#{selector})" do
|
|
34
|
-
before(:each) do
|
|
35
|
-
# mocking Which.which to find selector
|
|
36
|
-
SchemaDev::RubySelector._reset
|
|
37
|
-
allow(Which).to receive(:which) {|cmd| ["bash", selector].include?(cmd) ? "/usr/local/bin/#{cmd}" : nil }
|
|
38
|
-
case selector
|
|
39
|
-
when 'chruby-exec'
|
|
40
|
-
expect_any_instance_of(Pathname).to receive(:entries).and_return [Pathname.new("ruby-#{RUBY_VERSION}")]
|
|
41
|
-
when 'rbenv'
|
|
42
|
-
expect_any_instance_of(SchemaDev::RubySelector::Rbenv).to receive(:`).with("rbenv versions --bare").and_return RUBY_VERSION
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# mocking execution
|
|
46
|
-
original_popen2e = Open3.method(:popen2e)
|
|
47
|
-
allow(Open3).to receive(:popen2e) { |cmd, &block|
|
|
48
|
-
cmd = case cmd
|
|
49
|
-
when /false$/ then "false"
|
|
50
|
-
when /true$/ then "true"
|
|
51
|
-
else cmd.sub(/.*echo/, "echo")
|
|
52
|
-
end
|
|
53
|
-
original_popen2e.call(cmd, &block)
|
|
54
|
-
}
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
let(:config) { get_config(ruby: RUBY_VERSION, activerecord: "4.0", db: %W[sqlite3 postgresql]) }
|
|
58
|
-
let(:runner) { SchemaDev::Runner.new(config) }
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
let(:expected_output) { <<ENDOUTPUT.strip }
|
|
62
|
-
* Updated .travis.yml
|
|
63
|
-
* Updated gemfiles
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
*** ruby #{RUBY_VERSION} - activerecord 4.0 - db sqlite3 [1 of 2]
|
|
67
|
-
|
|
68
|
-
* /usr/bin/env BUNDLE_GEMFILE=gemfiles/activerecord-4.0/Gemfile.sqlite3 #{selection_command} %{cmd}
|
|
69
|
-
%{output}
|
|
70
|
-
|
|
71
|
-
*** ruby #{RUBY_VERSION} - activerecord 4.0 - db postgresql [2 of 2]
|
|
72
|
-
|
|
73
|
-
* /usr/bin/env BUNDLE_GEMFILE=gemfiles/activerecord-4.0/Gemfile.postgresql #{selection_command} %{cmd}
|
|
74
|
-
%{output}
|
|
75
|
-
ENDOUTPUT
|
|
76
|
-
|
|
77
|
-
it "runs successfully" do
|
|
78
|
-
in_tmpdir do
|
|
79
|
-
expect{ runner.run("true") }.to output(expected_output % {cmd: 'true', output: nil}).to_stdout
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
it "reports error exits" do
|
|
84
|
-
in_tmpdir do
|
|
85
|
-
expect{ runner.run("false") }.to output(expected_output % {cmd: 'false', output: nil} + <<-ENDERR).to_stdout
|
|
86
|
-
|
|
87
|
-
*** 2 failures:
|
|
88
|
-
\truby #{RUBY_VERSION} - activerecord 4.0 - db sqlite3
|
|
89
|
-
\truby #{RUBY_VERSION} - activerecord 4.0 - db postgresql
|
|
90
|
-
ENDERR
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it "reports error messages" do
|
|
95
|
-
in_tmpdir do
|
|
96
|
-
expect{ runner.run("echo", "LoadError") }.to output(expected_output % {cmd: 'echo LoadError', output: "LoadError\n"} + <<-ENDERR).to_stdout
|
|
97
|
-
|
|
98
|
-
*** 2 failures:
|
|
99
|
-
\truby #{RUBY_VERSION} - activerecord 4.0 - db sqlite3
|
|
100
|
-
\truby #{RUBY_VERSION} - activerecord 4.0 - db postgresql
|
|
101
|
-
ENDERR
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
end
|
data/spec/travis_spec.rb
DELETED
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
require 'schema_dev/travis'
|
|
2
|
-
|
|
3
|
-
describe SchemaDev::Travis do
|
|
4
|
-
|
|
5
|
-
it "creates travis file" do
|
|
6
|
-
config = get_config(ruby: %W[1.9.3 2.1.5],
|
|
7
|
-
activerecord: %W[4.0 4.1],
|
|
8
|
-
db: %W[mysql2 postgresql],
|
|
9
|
-
exclude: { ruby: "1.9.3", db: "postgresql" },
|
|
10
|
-
notify: 'me@example.com')
|
|
11
|
-
in_tmpdir do
|
|
12
|
-
SchemaDev::Travis.update(config)
|
|
13
|
-
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
|
14
|
-
# This file was auto-generated by the schema_dev tool, based on the data in
|
|
15
|
-
# ./schema_dev.yml
|
|
16
|
-
# Please do not edit this file; any changes will be overwritten next time
|
|
17
|
-
# schema_dev gets run.
|
|
18
|
-
---
|
|
19
|
-
rvm:
|
|
20
|
-
- 1.9.3
|
|
21
|
-
- 2.1.5
|
|
22
|
-
gemfile:
|
|
23
|
-
- gemfiles/activerecord-4.0/Gemfile.mysql2
|
|
24
|
-
- gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
25
|
-
- gemfiles/activerecord-4.1/Gemfile.mysql2
|
|
26
|
-
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
27
|
-
env: MYSQL_DB_USER=travis
|
|
28
|
-
before_script: bundle exec rake create_databases
|
|
29
|
-
after_script: bundle exec rake drop_databases
|
|
30
|
-
script: bundle exec rake travis
|
|
31
|
-
notifications:
|
|
32
|
-
email:
|
|
33
|
-
- me@example.com
|
|
34
|
-
jobs:
|
|
35
|
-
exclude:
|
|
36
|
-
- rvm: 1.9.3
|
|
37
|
-
gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
38
|
-
- rvm: 1.9.3
|
|
39
|
-
gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
40
|
-
include:
|
|
41
|
-
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
42
|
-
addons:
|
|
43
|
-
postgresql: '9.4'
|
|
44
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
45
|
-
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
46
|
-
addons:
|
|
47
|
-
postgresql: '9.4'
|
|
48
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
49
|
-
ENDTRAVIS
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
context 'when only using postgresql and not overriding the version' do
|
|
54
|
-
it "creates travis file using the default PG version" do
|
|
55
|
-
config = get_config(ruby: %W[2.4.0],
|
|
56
|
-
activerecord: %W[4.1],
|
|
57
|
-
db: %W[postgresql])
|
|
58
|
-
in_tmpdir do
|
|
59
|
-
SchemaDev::Travis.update(config)
|
|
60
|
-
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
|
61
|
-
# This file was auto-generated by the schema_dev tool, based on the data in
|
|
62
|
-
# ./schema_dev.yml
|
|
63
|
-
# Please do not edit this file; any changes will be overwritten next time
|
|
64
|
-
# schema_dev gets run.
|
|
65
|
-
---
|
|
66
|
-
rvm:
|
|
67
|
-
- 2.4.0
|
|
68
|
-
gemfile:
|
|
69
|
-
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
70
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
71
|
-
addons:
|
|
72
|
-
postgresql: '9.4'
|
|
73
|
-
before_script: bundle exec rake create_databases
|
|
74
|
-
after_script: bundle exec rake drop_databases
|
|
75
|
-
script: bundle exec rake travis
|
|
76
|
-
ENDTRAVIS
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
context 'when specifying a single postgresql version' do
|
|
82
|
-
it "creates travis file using that as the PG version" do
|
|
83
|
-
config = get_config(ruby: %W[2.4.0],
|
|
84
|
-
activerecord: %W[4.1],
|
|
85
|
-
db: %W[mysql2 postgresql],
|
|
86
|
-
dbversions: {postgresql: %W[9.6]})
|
|
87
|
-
in_tmpdir do
|
|
88
|
-
SchemaDev::Travis.update(config)
|
|
89
|
-
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
|
90
|
-
# This file was auto-generated by the schema_dev tool, based on the data in
|
|
91
|
-
# ./schema_dev.yml
|
|
92
|
-
# Please do not edit this file; any changes will be overwritten next time
|
|
93
|
-
# schema_dev gets run.
|
|
94
|
-
---
|
|
95
|
-
rvm:
|
|
96
|
-
- 2.4.0
|
|
97
|
-
gemfile:
|
|
98
|
-
- gemfiles/activerecord-4.1/Gemfile.mysql2
|
|
99
|
-
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
100
|
-
env: MYSQL_DB_USER=travis
|
|
101
|
-
before_script: bundle exec rake create_databases
|
|
102
|
-
after_script: bundle exec rake drop_databases
|
|
103
|
-
script: bundle exec rake travis
|
|
104
|
-
jobs:
|
|
105
|
-
include:
|
|
106
|
-
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
107
|
-
addons:
|
|
108
|
-
postgresql: '9.6'
|
|
109
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
110
|
-
ENDTRAVIS
|
|
111
|
-
end
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
context 'when specifying multiple postgresql versions with excludes' do
|
|
116
|
-
it "creates travis file including those variants for postgresql versions" do
|
|
117
|
-
config = get_config(ruby: %W[1.9.3 2.1.5 2.4.0],
|
|
118
|
-
activerecord: %W[4.0 4.1],
|
|
119
|
-
db: %W[mysql2 postgresql],
|
|
120
|
-
dbversions: {postgresql: %W[9.6 10 11]},
|
|
121
|
-
exclude: [{ ruby: "1.9.3", db: "postgresql" }])
|
|
122
|
-
in_tmpdir do
|
|
123
|
-
SchemaDev::Travis.update(config)
|
|
124
|
-
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
|
125
|
-
# This file was auto-generated by the schema_dev tool, based on the data in
|
|
126
|
-
# ./schema_dev.yml
|
|
127
|
-
# Please do not edit this file; any changes will be overwritten next time
|
|
128
|
-
# schema_dev gets run.
|
|
129
|
-
---
|
|
130
|
-
rvm:
|
|
131
|
-
- 1.9.3
|
|
132
|
-
- 2.1.5
|
|
133
|
-
- 2.4.0
|
|
134
|
-
gemfile:
|
|
135
|
-
- gemfiles/activerecord-4.0/Gemfile.mysql2
|
|
136
|
-
- gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
137
|
-
- gemfiles/activerecord-4.1/Gemfile.mysql2
|
|
138
|
-
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
139
|
-
env: MYSQL_DB_USER=travis
|
|
140
|
-
before_script: bundle exec rake create_databases
|
|
141
|
-
after_script: bundle exec rake drop_databases
|
|
142
|
-
script: bundle exec rake travis
|
|
143
|
-
jobs:
|
|
144
|
-
exclude:
|
|
145
|
-
- rvm: 1.9.3
|
|
146
|
-
gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
147
|
-
- rvm: 1.9.3
|
|
148
|
-
gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
149
|
-
include:
|
|
150
|
-
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
151
|
-
addons:
|
|
152
|
-
postgresql: '9.6'
|
|
153
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
154
|
-
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
155
|
-
addons:
|
|
156
|
-
postgresql: '10'
|
|
157
|
-
apt:
|
|
158
|
-
packages:
|
|
159
|
-
- postgresql-10
|
|
160
|
-
- postgresql-client-10
|
|
161
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
162
|
-
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
163
|
-
addons:
|
|
164
|
-
postgresql: '11'
|
|
165
|
-
apt:
|
|
166
|
-
packages:
|
|
167
|
-
- postgresql-11
|
|
168
|
-
- postgresql-client-11
|
|
169
|
-
env: POSTGRESQL_DB_USER=travis PGPORT=5433
|
|
170
|
-
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
171
|
-
addons:
|
|
172
|
-
postgresql: '9.6'
|
|
173
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
174
|
-
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
175
|
-
addons:
|
|
176
|
-
postgresql: '10'
|
|
177
|
-
apt:
|
|
178
|
-
packages:
|
|
179
|
-
- postgresql-10
|
|
180
|
-
- postgresql-client-10
|
|
181
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
182
|
-
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
183
|
-
addons:
|
|
184
|
-
postgresql: '11'
|
|
185
|
-
apt:
|
|
186
|
-
packages:
|
|
187
|
-
- postgresql-11
|
|
188
|
-
- postgresql-client-11
|
|
189
|
-
env: POSTGRESQL_DB_USER=travis PGPORT=5433
|
|
190
|
-
ENDTRAVIS
|
|
191
|
-
end
|
|
192
|
-
end
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
context 'when specifying only postgresql as the db with versions' do
|
|
196
|
-
it "creates travis file including only addon variants" do
|
|
197
|
-
config = get_config(ruby: %W[2.1.5 2.4.0],
|
|
198
|
-
activerecord: %W[4.0 4.1],
|
|
199
|
-
db: %W[postgresql],
|
|
200
|
-
dbversions: {postgresql: %W[9.6 10 11]})
|
|
201
|
-
in_tmpdir do
|
|
202
|
-
SchemaDev::Travis.update(config)
|
|
203
|
-
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
|
204
|
-
# This file was auto-generated by the schema_dev tool, based on the data in
|
|
205
|
-
# ./schema_dev.yml
|
|
206
|
-
# Please do not edit this file; any changes will be overwritten next time
|
|
207
|
-
# schema_dev gets run.
|
|
208
|
-
---
|
|
209
|
-
rvm:
|
|
210
|
-
- 2.1.5
|
|
211
|
-
- 2.4.0
|
|
212
|
-
gemfile:
|
|
213
|
-
- gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
214
|
-
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
215
|
-
before_script: bundle exec rake create_databases
|
|
216
|
-
after_script: bundle exec rake drop_databases
|
|
217
|
-
script: bundle exec rake travis
|
|
218
|
-
jobs:
|
|
219
|
-
include:
|
|
220
|
-
- addons:
|
|
221
|
-
postgresql: '9.6'
|
|
222
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
223
|
-
- addons:
|
|
224
|
-
postgresql: '10'
|
|
225
|
-
apt:
|
|
226
|
-
packages:
|
|
227
|
-
- postgresql-10
|
|
228
|
-
- postgresql-client-10
|
|
229
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
230
|
-
- addons:
|
|
231
|
-
postgresql: '11'
|
|
232
|
-
apt:
|
|
233
|
-
packages:
|
|
234
|
-
- postgresql-11
|
|
235
|
-
- postgresql-client-11
|
|
236
|
-
env: POSTGRESQL_DB_USER=travis PGPORT=5433
|
|
237
|
-
ENDTRAVIS
|
|
238
|
-
end
|
|
239
|
-
end
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
context 'when specifying multiple postgresql versions' do
|
|
243
|
-
it "creates travis file including those variants for postgresql versions" do
|
|
244
|
-
config = get_config(ruby: %W[2.1.5 2.4.0],
|
|
245
|
-
activerecord: %W[4.0 4.1],
|
|
246
|
-
db: %W[mysql2 postgresql],
|
|
247
|
-
dbversions: {postgresql: %W[9.6 10]})
|
|
248
|
-
in_tmpdir do
|
|
249
|
-
SchemaDev::Travis.update(config)
|
|
250
|
-
expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
|
|
251
|
-
# This file was auto-generated by the schema_dev tool, based on the data in
|
|
252
|
-
# ./schema_dev.yml
|
|
253
|
-
# Please do not edit this file; any changes will be overwritten next time
|
|
254
|
-
# schema_dev gets run.
|
|
255
|
-
---
|
|
256
|
-
rvm:
|
|
257
|
-
- 2.1.5
|
|
258
|
-
- 2.4.0
|
|
259
|
-
gemfile:
|
|
260
|
-
- gemfiles/activerecord-4.0/Gemfile.mysql2
|
|
261
|
-
- gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
262
|
-
- gemfiles/activerecord-4.1/Gemfile.mysql2
|
|
263
|
-
- gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
264
|
-
env: MYSQL_DB_USER=travis
|
|
265
|
-
before_script: bundle exec rake create_databases
|
|
266
|
-
after_script: bundle exec rake drop_databases
|
|
267
|
-
script: bundle exec rake travis
|
|
268
|
-
jobs:
|
|
269
|
-
include:
|
|
270
|
-
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
271
|
-
addons:
|
|
272
|
-
postgresql: '9.6'
|
|
273
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
274
|
-
- gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
|
|
275
|
-
addons:
|
|
276
|
-
postgresql: '10'
|
|
277
|
-
apt:
|
|
278
|
-
packages:
|
|
279
|
-
- postgresql-10
|
|
280
|
-
- postgresql-client-10
|
|
281
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
282
|
-
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
283
|
-
addons:
|
|
284
|
-
postgresql: '9.6'
|
|
285
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
286
|
-
- gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
|
|
287
|
-
addons:
|
|
288
|
-
postgresql: '10'
|
|
289
|
-
apt:
|
|
290
|
-
packages:
|
|
291
|
-
- postgresql-10
|
|
292
|
-
- postgresql-client-10
|
|
293
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
294
|
-
ENDTRAVIS
|
|
295
|
-
end
|
|
296
|
-
end
|
|
297
|
-
end
|
|
298
|
-
end
|