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

Add a travis yml #3

Merged
merged 5 commits into from Feb 25, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions .travis.yml
@@ -0,0 +1,13 @@
before_install:
- sudo apt-get update
- sudo apt-get install libgecode-dev
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we be uninstalling libgecode + libgedode-dev and using the bundled version, or are we just not quite there yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't have a bundled version right now, so this is the best we can do. Bundling gecode (assuming we do that) will be a fair bit of work since we'd need to make gecode's autotools based build work correctly with ruby's build conventions.

- gem --version

rvm:
- 1.9.3
- 2.0.0
- 2.1.0

script:
- bundle exec rake compile
- bundle exec rake spec
5 changes: 3 additions & 2 deletions dep_selector.gemspec
Expand Up @@ -18,6 +18,7 @@ Gem::Specification.new do |s|
s.files = Dir.glob("lib/**/*.{rb}") + Dir.glob("ext/**/*.{i,c,cxx,h,cpp,rb}")
s.extensions = Dir["ext/**/extconf.rb"]

s.add_development_dependency "uuidtools"
s.add_development_dependency "rspec"
s.add_development_dependency "uuidtools", "~> 2.1"
s.add_development_dependency "rspec", "~> 2.14"
s.add_development_dependency "rake-compiler", "~> 0.9.2"
end
130 changes: 66 additions & 64 deletions spec/dep_selector/selector_spec.rb
Expand Up @@ -18,11 +18,11 @@
{"key"=>["C", "3.0.0"], "value"=>{}}
]

simple_cookbook_version_constraint_3 =
[{"key"=>["A", "1.0.0"], "value"=>{"B"=>">= 1.0.0"}},
{"key"=>["B", "1.0.0"], "value"=>{}},
{"key"=>["B", "2.0.0"], "value"=>{}},
]
# simple_cookbook_version_constraint_3 =
# [{"key"=>["A", "1.0.0"], "value"=>{"B"=>">= 1.0.0"}},
# {"key"=>["B", "1.0.0"], "value"=>{}},
# {"key"=>["B", "2.0.0"], "value"=>{}},
# ]

moderate_cookbook_version_constraint =
[{"key"=>["A", "1.0.0"], "value"=>{"B"=>"= 2.0.0", "C"=>">= 2.0.0"}},
Expand All @@ -39,16 +39,16 @@
{"key"=>["D", "4.0.0"], "value"=>{}}
]

moderate_cookbook_version_constraint_2 =
[{"key"=>["A", "1.0"], "value"=>{"C"=>"< 4.0"}},
{"key"=>["B", "1.0"], "value"=>{"C"=>"< 3.0"}},
{"key"=>["C", "2.0"], "value"=>{"D"=>"> 1.0", "F"=>">= 0.0.0"}},
{"key"=>["C", "3.0"], "value"=>{"D"=>"> 2.0", "E"=>">= 0.0.0"}},
{"key"=>["D", "1.1"], "value"=>{}},
{"key"=>["D", "2.1"], "value"=>{}},
{"key"=>["E", "1.0"], "value"=>{}},
{"key"=>["F", "1.0"], "value"=>{}},
]
# moderate_cookbook_version_constraint_2 =
# [{"key"=>["A", "1.0"], "value"=>{"C"=>"< 4.0"}},
# {"key"=>["B", "1.0"], "value"=>{"C"=>"< 3.0"}},
# {"key"=>["C", "2.0"], "value"=>{"D"=>"> 1.0", "F"=>">= 0.0.0"}},
# {"key"=>["C", "3.0"], "value"=>{"D"=>"> 2.0", "E"=>">= 0.0.0"}},
# {"key"=>["D", "1.1"], "value"=>{}},
# {"key"=>["D", "2.1"], "value"=>{}},
# {"key"=>["E", "1.0"], "value"=>{}},
# {"key"=>["F", "1.0"], "value"=>{}},
# ]

moderate_cookbook_version_constraint_3 =
[{"key"=>["a", "1.0"], "value"=>{"c"=>"< 4.0"}},
Expand All @@ -67,53 +67,53 @@
]


big_cookbook_version_constraint_0 =
[{"key"=>["A", "1.0"], "value"=>{"B"=>"= 1.0"}}]

big_cookbook_version_constraint_1 =
[{"key"=>["A", "0.0.0"], "value"=>{"B"=>"<= 0.0.0"}},
{"key"=>["B", "0.0.0"], "value"=>{}},
{"key"=>["C", "0.0.0"], "value"=>{}},
{"key"=>["D", "0.0.0"], "value"=>{"E"=>"<= 0.0.0", "F"=>"<= 0.0.0", "C"=>"<= 0.0.0"}},
{"key"=>["E", "0.0.0"], "value"=>{}},
{"key"=>["F", "0.0.0"], "value"=>{}},
{"key"=>["G", "0.0.0"], "value"=>{}},
{"key"=>["H", "0.0.0"], "value"=>{}},
{"key"=>["I", "0.0.0"], "value"=>{}},
{"key"=>["I", "1.0.0"], "value"=>{}},
{"key"=>["J", "0.0.0"], "value"=>{"B"=>"<= 0.0.0"}},
{"key"=>["K", "0.0.0"], "value"=>{}},
{"key"=>["K", "1.0.0"], "value"=>{}},
{"key"=>["L", "0.0.0"], "value"=>{}},
{"key"=>["M", "0.0.0"], "value"=>{}},
{"key"=>["N", "0.0.0"], "value"=>{}},
{"key"=>["O", "0.0.0"], "value"=>{}},
{"key"=>["P", "0.0.0"], "value"=>{}},
{"key"=>["P", "1.0.0"], "value"=>{}},
{"key"=>["Q", "0.0.0"], "value"=>{}},
{"key"=>["Q", "1.0.0"], "value"=>{"R"=>"<= 0.0.0"}},
{"key"=>["R", "0.0.0"], "value"=>{}},
{"key"=>["S", "0.0.0"], "value"=>{"R"=>"<= 0.0.0"}},
{"key"=>["T", "0.0.0"], "value"=>{}},
{"key"=>["U", "0.0.0"], "value"=>{"O"=>"<= 0.0.0"}},
{"key"=>["V", "0.0.0"], "value"=>{}},
{"key"=>["W", "0.0.0"], "value"=>{}},
{"key"=>["X", "0.0.0"], "value"=>{}},
{"key"=>["Y", "0.0.0"], "value"=>{}},
{"key"=>["Y", "1.0.0"], "value"=>{}},
{"key"=>["Z", "0.0.0"], "value"=>{}},
{"key"=>["Z", "1.0.0"], "value"=>{"C"=>"<= 0.0.0"}},
{"key"=>["AA", "0.0.0"],
"value"=>
{ "A"=>"<= 0.0.0",
"C"=>"<= 0.0.0",
"D"=>"<= 0.0.0",
"G"=>"<= 0.0.0",
"H"=>"<= 0.0.0",
"I"=>"<= 1.0.0",
"J"=>"<= 0.0.0",
"K"=>"<= 1.0.0",
"L"=>"<= 0.0.0"}}]
# big_cookbook_version_constraint_0 =
# [{"key"=>["A", "1.0"], "value"=>{"B"=>"= 1.0"}}]
#
# big_cookbook_version_constraint_1 =
# [{"key"=>["A", "0.0.0"], "value"=>{"B"=>"<= 0.0.0"}},
# {"key"=>["B", "0.0.0"], "value"=>{}},
# {"key"=>["C", "0.0.0"], "value"=>{}},
# {"key"=>["D", "0.0.0"], "value"=>{"E"=>"<= 0.0.0", "F"=>"<= 0.0.0", "C"=>"<= 0.0.0"}},
# {"key"=>["E", "0.0.0"], "value"=>{}},
# {"key"=>["F", "0.0.0"], "value"=>{}},
# {"key"=>["G", "0.0.0"], "value"=>{}},
# {"key"=>["H", "0.0.0"], "value"=>{}},
# {"key"=>["I", "0.0.0"], "value"=>{}},
# {"key"=>["I", "1.0.0"], "value"=>{}},
# {"key"=>["J", "0.0.0"], "value"=>{"B"=>"<= 0.0.0"}},
# {"key"=>["K", "0.0.0"], "value"=>{}},
# {"key"=>["K", "1.0.0"], "value"=>{}},
# {"key"=>["L", "0.0.0"], "value"=>{}},
# {"key"=>["M", "0.0.0"], "value"=>{}},
# {"key"=>["N", "0.0.0"], "value"=>{}},
# {"key"=>["O", "0.0.0"], "value"=>{}},
# {"key"=>["P", "0.0.0"], "value"=>{}},
# {"key"=>["P", "1.0.0"], "value"=>{}},
# {"key"=>["Q", "0.0.0"], "value"=>{}},
# {"key"=>["Q", "1.0.0"], "value"=>{"R"=>"<= 0.0.0"}},
# {"key"=>["R", "0.0.0"], "value"=>{}},
# {"key"=>["S", "0.0.0"], "value"=>{"R"=>"<= 0.0.0"}},
# {"key"=>["T", "0.0.0"], "value"=>{}},
# {"key"=>["U", "0.0.0"], "value"=>{"O"=>"<= 0.0.0"}},
# {"key"=>["V", "0.0.0"], "value"=>{}},
# {"key"=>["W", "0.0.0"], "value"=>{}},
# {"key"=>["X", "0.0.0"], "value"=>{}},
# {"key"=>["Y", "0.0.0"], "value"=>{}},
# {"key"=>["Y", "1.0.0"], "value"=>{}},
# {"key"=>["Z", "0.0.0"], "value"=>{}},
# {"key"=>["Z", "1.0.0"], "value"=>{"C"=>"<= 0.0.0"}},
# {"key"=>["AA", "0.0.0"],
# "value"=>
# { "A"=>"<= 0.0.0",
# "C"=>"<= 0.0.0",
# "D"=>"<= 0.0.0",
# "G"=>"<= 0.0.0",
# "H"=>"<= 0.0.0",
# "I"=>"<= 1.0.0",
# "J"=>"<= 0.0.0",
# "K"=>"<= 1.0.0",
# "L"=>"<= 0.0.0"}}]

big_cookbook_version_constraint_2 =
[{"key"=>["A", "0.0"], "value"=>{"B"=>"<= 0.0", "C"=>"<= 12.0"}},
Expand Down Expand Up @@ -879,7 +879,9 @@
end
end

it "solves moderately complex dependency graph #3 and times out" do
it "solves moderately complex dependency graph #3 and times out", :volatile do
# This test does not reliably trigger timeout.
pending("test unreliable, investigate")
dep_graph = DepSelector::DependencyGraph.new
setup_constraint(dep_graph, big_cookbook_version_constraint_2)
selector = DepSelector::Selector.new(dep_graph, 0.001)
Expand All @@ -890,7 +892,7 @@
selector.find_solution(constraints)
end.to raise_error(DepSelector::Exceptions::TimeBoundExceeded)

end
end

# TODO [cw,2011/2/4]: Add a test for a set of solution constraints
# that contains multiple restrictions on the same package. Do the
Expand Down
11 changes: 11 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -21,6 +21,17 @@
$:.unshift(File.expand_path("../../ext/dep_gecode", __FILE__))
require 'dep_selector'
require 'pp'
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.treat_symbols_as_metadata_keys_with_true_values = true

config.filter_run :focus => true
config.filter_run_excluding :external => true

# Tests that randomly fail, but may have value.
config.filter_run_excluding :volatile => true
end


def setup_constraint(dep_graph, cset)
cset.each do |cb_version|
Expand Down