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

Fix: Some skipped tests #130

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions test/test_chunks_write.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def test_put_delete_data
end

def test_reentrant_queries
skip "TODO: why does this test fail?"
ntriples_file_path = "./test/data/nemo_ontology.ntriples"

# Bypass in chunks
Expand All @@ -87,8 +86,8 @@ def test_reentrant_queries

tput = Thread.new {
Goo.sparql_data_client.put_triples(ONT_ID_EXTRA, ntriples_file_path, mime_type="application/x-turtle")
sleep(1.5)
}
sleep(1.5)
count_queries = 0
tq = Thread.new {
5.times do
Expand All @@ -112,8 +111,8 @@ def test_reentrant_queries

tdelete = Thread.new {
Goo.sparql_data_client.delete_graph(ONT_ID_EXTRA)
sleep(1.5)
}
sleep(1.5)
count_queries = 0
tq = Thread.new {
5.times do
Expand Down
18 changes: 9 additions & 9 deletions test/test_collections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ def test_unique_per_collection
def test_inverse_on_collection
skip "Not supported inverse on collection"

john = User.find("John").include(:name).first ||
User.new(name: "John").save()
john = User.find("John").include(:name).first || User.new(name: "John").save

5.times do |i|
Issue.new(description: "issue_#{i}", owner: john).save
Issue.find("issue_#{i}").in(john) || Issue.new(description: "issue_#{i}", owner: john).save
end

binding.pry
User.find("John",include: [:issues]).first.issues
User.find("John",include: [issues: [:desciption]]).first.issues

5.times do |i|
Issue.find("issue_#{i}", collection: john).delete
issues = User.find("John").include(:issues).first.issues
assert_equal 5, issues.size

issues.each do |issue|
assert_equal "issue_#{i}", issue.description
assert_equal john, issue.collection
end
end

Expand Down
10 changes: 8 additions & 2 deletions test/test_read_only.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ def test_struct_find
end

def test_embed_struct
skip "not yet"

students = Student.where(enrolled: [university: [name: "Stanford"]])
.include(:name)
.include(enrolled: [:name, university: [ :address ]])
.include(enrolled: [:name, university: [ :address, :name ]])
.read_only.all

assert_equal 3, students.size
students.each do |st|
assert st.enrolled.any? {|e| e.is_a?(Struct) && e.university.name.eql?('Stanford')}
end

end
end
end