Skip to content

Commit

Permalink
Merge pull request #52 from Sage-Bionetworks-Workflows/bwmac/ORCA-288…
Browse files Browse the repository at this point in the history
…/test_object_refactor

[ORCA-288] Test Object Naming Refactor
  • Loading branch information
BWMac authored Dec 15, 2023
2 parents 7c70732 + abf5dab commit b682d1e
Show file tree
Hide file tree
Showing 12 changed files with 1,151 additions and 1,164 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ jobs:
with: {python-version: "3.11"}
- name: Run static analysis and format checkers
run: pipx run pre-commit run --all-files --show-diff-on-failure
- name: Install tox-gh plugin
run: python -m pip install tox-gh>=1.2
- name: Build package distribution files
run: pipx run --spec 'tox~=3.0' tox -e clean,build
run: tox -e clean,build
- name: Record the paths of wheel and source tarball distributions
id: distribution-paths
run: |
Expand All @@ -58,7 +60,7 @@ jobs:
strategy:
matrix:
python:
- "3.8"
- "3.9" # oldest Python that is supported
- "3.11" # newest Python that is stable
platform:
- ubuntu-latest
Expand All @@ -76,12 +78,15 @@ jobs:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v3
with: {name: python-distribution-files, path: dist/}
- name: Install tox-gh plugin
run: python -m pip install tox-gh>=1.2
- name: Setup test suite
run: tox -vv --notest
- name: Run tests
env:
SYNAPSE_AUTH_TOKEN: ${{ secrets.SYNAPSE_AUTH_TOKEN }}
run: >-
pipx run --spec 'tox~=3.0' tox
--installpkg '${{ needs.prepare.outputs.wheel-path }}'
tox --installpkg '${{ needs.prepare.outputs.wheel-path }}'
-- -rFEx --durations 10 --color yes
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ formats:
- pdf

python:
version: 3.8
version: 3.9
install:
- requirements: docs/requirements.txt
- {path: ., method: pip}
1,326 changes: 639 additions & 687 deletions Pipfile.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package_dir =
=src

# Require a min/specific Python version (comma-separated conditions)
python_requires = >=3.8
python_requires = >=3.9, <3.12

# Add here dependencies of your project (line-separated), e.g. requests>=2.2,<3.0.
# Version specifiers like >=2.2,<3.0 avoid problems due to API changes in
Expand Down Expand Up @@ -82,7 +82,6 @@ testing =
# Dependencies for development (used by Pipenv)
dev =
pre-commit~=2.0
tox~=3.0
sphinx-rtd-theme~=1.0
black~=22.0
flake8~=5.0
Expand Down
33 changes: 16 additions & 17 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ def test_files(get_data):
}
test_files = {
"date_in_tag_tiff": File(tiff_date_in_tag_path.as_posix(), tiff_metadata),
"good": File(txt_path.as_posix(), good_metadata),
"date_txt": File(date_path.as_posix(), date_txt_metadata),
"ome_tiff": File(ome_tiff_path.as_posix(), ome_tiff_metadata),
"good_txt": File(txt_path.as_posix(), good_metadata),
"date_string_txt": File(date_path.as_posix(), date_txt_metadata),
"good_ome_tiff": File(ome_tiff_path.as_posix(), ome_tiff_metadata),
"invalid_xml_tiff": File(
invalid_xml_ome_tiff_path.as_posix(), invalid_xml_metadata
),
"bad": File(txt_path.as_posix(), bad_metadata),
"tiff": File(tiff_path.as_posix(), tiff_metadata),
"fastq1": File(fastq1_path.as_posix(), fastq_metadata),
"fastq2": File(fastq2_path.as_posix(), fastq_metadata),
"jsonld": File(jsonld_path.as_posix(), jsonld_metadata),
"synapse": File(syn_path, good_metadata),
"tiff_dirty_datetime": File(
"wrong_file_type_and_md5_txt": File(txt_path.as_posix(), bad_metadata),
"good_tiff": File(tiff_path.as_posix(), tiff_metadata),
"good_fastq": File(fastq1_path.as_posix(), fastq_metadata),
"good_compressed_fastq": File(fastq2_path.as_posix(), fastq_metadata),
"good_jsonld": File(jsonld_path.as_posix(), jsonld_metadata),
"good_synapse": File(syn_path, good_metadata),
"dirty_datetime_in_tag_tiff": File(
tiff_dirty_datetime_path.as_posix(), tiff_dirty_datetime_metadata
),
}
Expand All @@ -127,18 +127,16 @@ def test_files(get_data):

@pytest.fixture
def test_targets(test_files):
test_targets = dict()
for name, file in test_files.items():
test_targets[name] = SingleTarget(file)
test_targets = {name: SingleTarget(file) for name, file in test_files.items()}
yield test_targets


@pytest.fixture
def test_suites(test_targets):
test_suites = dict()
for name, target in test_targets.items():
test_suites[name] = SuiteABC.from_target(target)
yield test_suites
test_suites_dict = {
name: SuiteABC.from_target(target) for name, target in test_targets.items()
}
return test_suites_dict


@pytest.fixture
Expand Down Expand Up @@ -171,6 +169,7 @@ def mocked_suites_single_targets():
return mocked_suites


# TODO: Add this once we have multi-targets
# @pytest.fixture
# def mocked_suites_multi_targets():
# mock_dict_multi = {
Expand Down
Loading

0 comments on commit b682d1e

Please sign in to comment.