Skip to content

Commit

Permalink
ENCD-5433-refactor-not-bdd-not-indexing-tests (#3445)
Browse files Browse the repository at this point in the history
  • Loading branch information
hitz authored Jul 27, 2020
1 parent e24a9b1 commit 3efa764
Show file tree
Hide file tree
Showing 41 changed files with 127 additions and 130 deletions.
7 changes: 2 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ jobs:
- browser-tools/install-chromedriver
- run:
name: Run bdd tests
# collected 2189 items / 2119 deselected / 70 selected
command: |
bin/test -s -vv -m "bdd" --tb=short \
--splinter-implicit-wait 10 \
Expand All @@ -87,8 +86,7 @@ jobs:
- run:
name: non bdd indexing tests
command: |
# collected 2189 items / 2184 deselected / 5 selected
bin/test -s -vv -m "not bdd" -k test_indexing
bin/test -s -vv -m "indexing"
not-bdd-non-indexing:
executor: encoded-executor
resource_class: large
Expand All @@ -97,8 +95,7 @@ jobs:
- run:
name: non bdd non indexing tests
command: |
# collected 2189 items / 75 deselected / 2114 selected
bin/test -s -vv -m "not bdd" -k 'not test_indexing'
bin/test -s -vv -m "not bdd and not indexing"
npm:
executor: encoded-executor
resource_class: large
Expand Down
4 changes: 2 additions & 2 deletions circle-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ if [ "$1" == "bdd" ]; then
fi

if [ "$1" == "not-bdd-indexing" ]; then
bin/test -s -vv -m "not bdd" -k test_indexing
bin/test -s -vv -m "indexing"
exit
fi

if [ "$1" == "not-bdd-non-indexing" ]; then
bin/test -s -vv -m "not bdd" -k 'not test_indexing'
bin/test -s -vv -m "not bdd and not indexing"
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/advanced_query_search.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@advanced_query_search @usefixtures(workbook)
@advanced_query_search @usefixtures(index_workbook)
Feature: Search
Background:
When I visit "/search"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/antibodies.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@antibodies @usefixtures(workbook)
@antibodies @usefixtures(index_workbook)
Feature: Antibodies

Scenario: Collection
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/audit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Title
And I wait for the content to load
Then the title should contain the text "Audit – ENCODE"

@audit @usefixtures(workbook)
@audit @usefixtures(index_workbook)
Feature: Audit
Background:
When I visit "/audit/?type=Experiment"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/batch_hubs.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@batchhubs @usefixtures(workbook)
@batchhubs @usefixtures(index_workbook)
Feature: Batch Hubs
Background:
When I visit "/search/?type=Experiment&status=released"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/biosamples.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@biosamples @usefixtures(workbook)
@biosamples @usefixtures(index_workbook)
Feature: Biosamples

Scenario: Detail page
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/cart.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@cart @usefixtures(workbook)
@cart @usefixtures(index_workbook)
Feature: Cart
Scenario: Search result cart toggles:
When I visit "/search/?type=Experiment"
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/tests/features/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def app(app_settings):

@pytest.mark.fixture_cost(500)
@pytest.yield_fixture(scope='session')
def workbook(request, app):
def index_workbook(request, app):
from snovault import DBSESSION
connection = app.registry[DBSESSION].bind.pool.unique_connection()
connection.detach()
Expand Down Expand Up @@ -97,7 +97,7 @@ def splinter_window_size():

# Depend on workbook fixture here to avoid remote browser timeouts.
@pytest.fixture(scope='session')
def browser(workbook, session_browser):
def browser(index_workbook, session_browser):
return session_browser


Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/experiments.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@experiments @usefixtures(workbook)
@experiments @usefixtures(index_workbook)
Feature: Experiments

Scenario: Collection
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/forms.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@forms @usefixtures(workbook,admin_user)
@forms @usefixtures(index_workbook,admin_user)
Feature: Edit forms

Scenario: Save a change to an antibody
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/generics.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@generics @usefixtures(workbook)
@generics @usefixtures(index_workbook)
Feature: Generics

Scenario Outline: Generics
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/matrix_chip_seq.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@matrix @usefixtures(workbook)
@matrix @usefixtures(index_workbook)
Feature: Matrix
Scenario: ChIP-seq matrix
When I visit "/"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/matrix_entex.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@matrix @usefixtures(workbook)
@matrix @usefixtures(index_workbook)
Feature: Matrix
Scenario: Matrix ENTEx
When I visit "/"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/matrix_experiment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Title
And I wait for the content to load
Then the title should contain the text "Matrix – ENCODE"

@matrix @usefixtures(workbook)
@matrix @usefixtures(index_workbook)
Feature: Matrix
Background:
When I visit "/matrix/?type=Experiment&status=released"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@matrix @usefixtures(workbook)
@matrix @usefixtures(index_workbook)
Feature: Matrix
Scenario: Mouse development matrix
When I visit "/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@matrix @usefixtures(workbook)
@matrix @usefixtures(index_workbook)
Feature: Matrix
Scenario: Matrix Reference Epigenome
When I visit "/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@matrix @usefixtures(workbook)
@matrix @usefixtures(index_workbook)
Feature: Matrix
Scenario: Matrix Reference Epigenome
When I visit "/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@matrix @usefixtures(workbook)
@matrix @usefixtures(index_workbook)
Feature: Matrix
Scenario: Matrix Reference Epigenome
When I visit "/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@matrix @usefixtures(workbook)
@matrix @usefixtures(index_workbook)
Feature: Matrix
Scenario: Matrix Reference Epigenome
When I visit "/"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/matrix_sescc_stem_cell.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@matrix @usefixtures(workbook)
@matrix @usefixtures(index_workbook)
Feature: Matrix
Scenario: SESCC-Stem-Cell-Matrix
When I visit "/"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/page.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@page @usefixtures(workbook,admin_user)
@page @usefixtures(index_workbook,admin_user)
Feature: Portal pages

Scenario: Render page layout
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/report.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Title
And I wait for the content to load
Then the title should contain the text "Report – ENCODE"

@report @usefixtures(workbook)
@report @usefixtures(index_workbook)
Feature: Report
Background:
When I visit "/report/?type=Experiment"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/search.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@search @usefixtures(workbook)
@search @usefixtures(index_workbook)
Feature: Search
Background:
When I visit "/search"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/summary.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Title
And I wait for the content to load
Then the title should contain the text "Summary – ENCODE"

@Summary @usefixtures(workbook)
@Summary @usefixtures(index_workbook)
Feature: Summary
Background:
When I visit "/summary/?type=Experiment&status=released"
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/targets.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@targets @usefixtures(workbook)
@targets @usefixtures(index_workbook)
Feature: Targets

Scenario: Collection
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/test_admin_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pytestmark = [
pytest.mark.bdd,
pytest.mark.usefixtures('workbook', 'admin_user'),
pytest.mark.usefixtures('index_workbook', 'admin_user'),
]


Expand Down
4 changes: 2 additions & 2 deletions src/encoded/tests/features/test_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

pytestmark = [
pytest.mark.bdd,
pytest.mark.usefixtures('workbook'),
pytest.mark.usefixtures('index_workbook'),
]


def test_auditview(testapp, workbook):
def test_auditview(testapp, index_workbook):
res = testapp.get('/audit/?type=Experiment')
assert res.json['matrix']

Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/test_batch_hubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

pytestmark = [
pytest.mark.bdd,
pytest.mark.usefixtures('workbook'),
pytest.mark.usefixtures('index_workbook'),
]

scenarios(
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/test_cart.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

pytestmark = [
pytest.mark.bdd,
pytest.mark.usefixtures('workbook'),
pytest.mark.usefixtures('index_workbook'),
]

scenarios(
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/test_generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

pytestmark = [
pytest.mark.bdd,
pytest.mark.usefixtures('workbook'),
pytest.mark.usefixtures('index_workbook'),
]

scenarios('generics.feature', strict_gherkin=False)
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

pytestmark = [
pytest.mark.bdd,
pytest.mark.usefixtures('workbook'),
pytest.mark.usefixtures('index_workbook'),
]

scenarios(
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

pytestmark = [
pytest.mark.bdd,
pytest.mark.usefixtures('workbook'),
pytest.mark.usefixtures('index_workbook'),
]

scenarios(
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/test_submitter_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pytestmark = [
pytest.mark.bdd,
pytest.mark.usefixtures('workbook', 'submitter_user'),
pytest.mark.usefixtures('index_workbook', 'submitter_user'),
]


Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

pytestmark = [
pytest.mark.bdd,
pytest.mark.usefixtures('workbook'),
pytest.mark.usefixtures('index_workbook'),
]

scenarios(
Expand Down
21 changes: 11 additions & 10 deletions src/encoded/tests/features/test_trackhubs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest

pytestmark = [pytest.mark.indexing]

@pytest.mark.parametrize('expected', [
"# http://localhost/batch_hub/type=Experiment/hub.txt",
Expand All @@ -9,7 +10,7 @@
"genomesFile genomes.txt",
"email encode-help@lists.stanford.edu"
])
def test_hub(testapp, workbook, expected):
def test_hub(testapp, index_workbook, expected):
res = testapp.get("/batch_hub/type=Experiment/hub.txt")
assert expected in res.text

Expand All @@ -22,7 +23,7 @@ def test_hub(testapp, workbook, expected):
"genome hg19",
"trackDb hg19/trackDb.txt",
])
def test_genomes(testapp, workbook, expected):
def test_genomes(testapp, index_workbook, expected):
res = testapp.get("/batch_hub/type=Experiment/genomes.txt")
assert expected in res.text

Expand Down Expand Up @@ -53,7 +54,7 @@ def test_genomes(testapp, workbook, expected):
" type bigBed",
" subGroups BS=IMR4590 EXP=ENCSR575ZXX REP=pool view=cSTATE",
])
def test_dataset_trackDb(testapp, workbook, expected):
def test_dataset_trackDb(testapp, index_workbook, expected):
res = testapp.get("/annotations/ENCSR575ZXX/@@hub/hg19/trackDb.txt")
assert expected in res.text

Expand Down Expand Up @@ -90,23 +91,23 @@ def test_dataset_trackDb(testapp, workbook, expected):
" altColor 115,31,0",
" subGroups BS=GM12878 EXP=ENCSR000DZQ REP=pool TARG=EBF1 view=bIDRT",
])
def test_genomes(testapp, workbook, expected):
def test_genomes(testapp, index_workbook, expected):
res = testapp.get("/batch_hub/type=Experiment%2C%2caccession%3DENCSR000DZQ%2C%2caccession%3DENCSRENCSR575ZXX/hg19/trackDb.txt")
assert expected in res.text


@pytest.mark.parametrize('expected', [
""
])
def test_fileset_files_trackDb(testapp, workbook, expected):
def test_fileset_files_trackDb(testapp, index_workbook, expected):
res = testapp.get("/publication-data/ENCSR727WCB/@@hub/hg19/trackDb.txt")
assert expected in res.text


@pytest.mark.parametrize('expected', [
"# Empty composite for ENCSR000ACY. It cannot be visualized at this time.",
])
def test_experiment_trackDb(testapp, workbook, expected):
def test_experiment_trackDb(testapp, index_workbook, expected):
res = testapp.get("/experiments/ENCSR000ACY/@@hub/trackDb.txt")
assert expected in res.text

Expand All @@ -115,28 +116,28 @@ def test_experiment_trackDb(testapp, workbook, expected):
"genome hg38",
"trackDb hg38/trackDb.txt",
])
def test_genome_txt(testapp, workbook, expected):
def test_genome_txt(testapp, index_workbook, expected):
res = testapp.get("/batch_hub/type=Experiment&assembly=GRCh38/genomes.txt")
assert expected in res.text

@pytest.mark.parametrize('expected', [
"GRCh38",
"hg19"
])
def test_assembly(testapp, workbook, expected):
def test_assembly(testapp, index_workbook, expected):
res = testapp.get("/experiments/ENCSR000AEN/")
assert expected in res.json['assembly']


@pytest.mark.parametrize('expected', [
"/experiments/ENCSR000AEN/@@hub/hub.txt",
])
def test_hub_field(testapp, workbook, expected):
def test_hub_field(testapp, index_workbook, expected):
res = testapp.get("/experiments/ENCSR000AEN/")
assert expected in res.json['hub']


def test_visualize(submitter_testapp, workbook):
def test_visualize(submitter_testapp, index_workbook):
expected = {
'GRCh38': [
"Ensembl",
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/tests/features/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

pytestmark = [
pytest.mark.bdd,
pytest.mark.usefixtures('workbook'),
pytest.mark.usefixtures('index_workbook'),
]

scenarios(
Expand Down
Loading

0 comments on commit 3efa764

Please sign in to comment.