Skip to content

Commit

Permalink
skip openbis tests rather than just returning
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Jan 29, 2025
1 parent 31893ba commit e2cddec
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions test/unit/openbis/entity_type_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,13 @@ def setup
@openbis_endpoint.clear_metadata_store
end

def test_warn_on_mocked_tests
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?
assert true
end

# test 'check if mock present' do
# skip 'only to check if the mocked? implementation works'
# refute self.class.mocked?
# mock_openbis_calls
# assert self.class.mocked?
# end

test 'setup work' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?
assert @openbis_endpoint.test_authentication
end

test 'SampleType by code' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

code = 'EXPERIMENTAL_STEP'
type = Seek::Openbis::EntityType.SampleType(@openbis_endpoint, code, true)
Expand All @@ -51,7 +39,7 @@ def test_warn_on_mocked_tests
end

test 'SampleType all' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

types = Seek::Openbis::EntityType.SampleType(@openbis_endpoint).all(true)
assert types
Expand All @@ -62,7 +50,6 @@ def test_warn_on_mocked_tests
end

test 'SampleType by semantic annotation' do
return if EntityTypeTest.mocked?
skip 'Semantic annotations are not currently available in OBIS production releases'
semantic = Seek::Openbis::SemanticAnnotation.new

Expand Down Expand Up @@ -94,7 +81,7 @@ def test_warn_on_mocked_tests
end

test 'Samples can be found by types codes' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

codes = ['EXPERIMENTAL_STEP']

Expand All @@ -114,15 +101,15 @@ def test_warn_on_mocked_tests
end

test 'All samples can be found' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

zamples = Seek::Openbis::Zample.new(@openbis_endpoint).all
assert zamples
assert_equal 16, zamples.size
end

test 'DataSetType by code' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

code = 'RAW_DATA'
type = Seek::Openbis::EntityType.DataSetType(@openbis_endpoint, code, true)
Expand All @@ -133,7 +120,7 @@ def test_warn_on_mocked_tests
end

test 'DatasetType all' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

types = Seek::Openbis::EntityType.DataSetType(@openbis_endpoint).all(true)
assert types
Expand All @@ -144,7 +131,7 @@ def test_warn_on_mocked_tests
end

test 'DataSets can be found by types codes' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

codes = ['RAW_DATA']

Expand All @@ -164,7 +151,7 @@ def test_warn_on_mocked_tests
end

test 'ExperimentType by code' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

code = 'DEFAULT_EXPERIMENT'
type = Seek::Openbis::EntityType.ExperimentType(@openbis_endpoint, code, true)
Expand All @@ -175,7 +162,7 @@ def test_warn_on_mocked_tests
end

test 'ExperimentType all' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

types = Seek::Openbis::EntityType.ExperimentType(@openbis_endpoint).all(true)
assert types
Expand All @@ -186,7 +173,7 @@ def test_warn_on_mocked_tests
end

test 'ExperimentType by codes' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

codes = %w[DEFAULT_EXPERIMENT MATERIALS]
types = Seek::Openbis::EntityType.ExperimentType(@openbis_endpoint).find_by_codes(codes, true)
Expand All @@ -198,7 +185,7 @@ def test_warn_on_mocked_tests
end

test 'Experiment can be found by types codes' do
return if EntityTypeTest.mocked?
skip 'EntityType tests skipped as mocked query detected' if EntityTypeTest.mocked?

codes = ['DEFAULT_EXPERIMENT']

Expand Down

0 comments on commit e2cddec

Please sign in to comment.