Skip to content

Commit

Permalink
control whether the integration tests are run with an env variable #15
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Apr 13, 2021
1 parent 8528885 commit 2515787
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
runs-on: ubuntu-latest
env:
CI: true
VIRTUOSO_INTEGRATION_TESTS: true
strategy:
fail-fast: false
matrix:
Expand Down
15 changes: 9 additions & 6 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
require File.join(File.dirname(__FILE__), 'spec_helper')
require 'rdf/spec/repository'

# these tests rely on a Virtuoso instance being available, at port 8890, and will otherwise fail
# these tests rely on a Virtuoso service being available, at port 8890
# the easiest way to do this is with docker ( https://docs.docker.com/get-docker/ ), running the following:
# docker run -p 8890:8890 -p 1111:1111 -e DBA_PASSWORD=tester -e SPARQL_UPDATE=true --name virtuoso-testing -d tenforce/virtuoso
# when finished you can stop with
# docker stop virtuoso-testing
#
# to avoid the tests being skipped, you will need to set the environment variable VIRTUOSO_INTEGRATION_TESTS, e.g.
# VIRTUOSO_INTEGRATION_TESTS=true bundle exec rspec spec

describe RDF::Virtuoso::Repository do
context('when interacting with a virtuoso repository instance') do
skip = ENV['VIRTUOSO_INTEGRATION_TESTS'] ? false : 'Skipping Integration tests against a running repository, see spec/integration_spec.rb'

describe RDF::Virtuoso::Repository, skip: skip do
context('when interacting with a virtuoso repository service') do
subject(:repository) do
described_class.new(uri,
update_uri: update_uri,
Expand All @@ -28,7 +33,6 @@

it 'is able to select' do
# check a single triple result which is unlikely to change

query = RDF::Virtuoso::Query.select.where([RDF::URI('http://localhost:8890/sparql'),
RDF::URI('http://www.w3.org/ns/sparql-service-description#endpoint'), :o])

Expand All @@ -47,7 +51,6 @@
end

# commented out until conformance issues are resolved, otherwise there are many errors
# it_behaves_like "an RDF::Repository"

# it_behaves_like "an RDF::Repository"
end
end

0 comments on commit 2515787

Please # to comment.