-
Notifications
You must be signed in to change notification settings - Fork 31
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
Creates new GitHub Action for standalone testing #499
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much @gibsramen! This is super helpful.
.github/workflows/standalone.yml
Outdated
# we can add more versions of node.js in the future | ||
strategy: | ||
matrix: | ||
node-version: [14.x] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are just running Python tests here I think we can avoid setting up the JS stuff -- this'll save time and energy. However, it might be nice to test multiple python versions with the standalone tests if this is possible. Here's an attempt at that. (Not sure if this will work as intended -- if this change breaks things we can add it in a later PR.)
# we can add more versions of node.js in the future | |
strategy: | |
matrix: | |
node-version: [14.x] | |
strategy: | |
matrix: | |
# based roughly on https://github.com/conda-incubator/setup-miniconda#example-1-basic-usage | |
python-version: ["3.6", "3.7", "3.8", "3.9"] |
.github/workflows/standalone.yml
Outdated
|
||
- name: Set up Node.js enviroment | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Set up Node.js enviroment | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 |
.github/workflows/standalone.yml
Outdated
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: empress | ||
python-version: 3.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the suggestion about testing multiple python versions I made above.
python-version: 3.6 | |
# https://github.com/conda-incubator/setup-miniconda#example-1-basic-usage | |
python-version: ${{ matrix.python-version }} |
.github/workflows/standalone.yml
Outdated
run: pip install -e .[all] | ||
|
||
# tests that don't import qiime2 dependencies | ||
- name: Run Python tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Run Python tests | |
- name: Run (non-QIIME 2) Python tests |
Figure we might as well be explicit about it :)
tests/python/util.py
Outdated
PREFIX_DIR = os.path.join("docs", "moving-pictures") | ||
|
||
|
||
def extracted_artifact_path(dir_name, artifact_loc, file_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things:
-
Could you add a docstring for this function? Doesn't have to be anything fancy or long, just at least a brief description of what this does and what the params do.
-
Unless I'm misinterpreting things, it might make sense to rename this function to
extract_q2_artifact_to_path()
or something more direct than the current name -- the use ofextracted_
makes it seem like this function is just finding a path that already exists, when from what I can tell it's actually creating a path.
tests/python/util.py
Outdated
"taxonomy.tsv") | ||
fmd = pd.read_csv(tax_loc, sep="\t", index_col=0) | ||
md = pd.read_csv(md_loc, sep="\t", index_col=0, skiprows=[1]) | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass |
tests/python/util.py
Outdated
|
||
Returns | ||
------- | ||
(tree, table, md, fmd, ordination) | ||
tree: Artifact with semantic type Phylogeny[Rooted] | ||
Phylogenetic tree. | ||
table: Artifact with semantic type FeatureTable[Frequency] | ||
Feature table. | ||
md: Metadata | ||
Sample metadata. | ||
fmd: Metadata | ||
Feature metadata. (Although this is stored in the repository as a | ||
FeatureData[Taxonomy] artifact, we transform it to Metadata.) | ||
pcoa: Artifact with semantic type PCoAResults | ||
Ordination. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns | |
------- | |
(tree, table, md, fmd, ordination) | |
tree: Artifact with semantic type Phylogeny[Rooted] | |
Phylogenetic tree. | |
table: Artifact with semantic type FeatureTable[Frequency] | |
Feature table. | |
md: Metadata | |
Sample metadata. | |
fmd: Metadata | |
Feature metadata. (Although this is stored in the repository as a | |
FeatureData[Taxonomy] artifact, we transform it to Metadata.) | |
pcoa: Artifact with semantic type PCoAResults | |
Ordination. | |
Parameters | |
---------- | |
use_artifact_api: bool, optional (default True) | |
If True, this will load the artifacts using the QIIME 2 Artifact API, | |
and the returned objects will have types corresponding to the first | |
listed types (before the | characters) shown below. | |
If False, this will instead load the artifacts without using QIIME 2's | |
APIs; in this case, the returned objects will have types corresponding | |
to the second listed types (after the | characters) shown below. | |
Returns | |
------- | |
(tree, table, md, fmd, ordination) | |
tree: qiime2.Artifact | skbio.tree.TreeNode | |
Phylogenetic tree. | |
table: qiime2.Artifact | biom.Table | |
Feature table. | |
md: qiime2.Metadata | pandas.DataFrame | |
Sample metadata. | |
fmd: qiime2.Metadata | pandas.DataFrame | |
Feature metadata. (Although this is stored in the repository as a | |
FeatureData[Taxonomy] artifact, we transform it to Metadata if | |
use_artifact_api is True.) | |
pcoa: qiime2.Artifact | skbio.OrdinationResults | |
Ordination. |
There may be a more official way to structure this docstring, but I think this makes it pretty clear
tests/python/test_cli.py
Outdated
fm.to_csv(cls.fm_loc, index=True, sep="\t") | ||
pcoa.write(cls.pcoa_loc) | ||
# extract Artifacts to temporary filesystem | ||
# glob used because Artifacts unzip to UUIDs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# glob used because Artifacts unzip to UUIDs |
(I think this comment should still be kept around in the codebase, but it should be moved down to the util.extract...()
function's docstring)
The following artifacts were built for this PR: empire-biplot.qzv, empire.qzv, empress-tree.qzv, just-fm.qzv, plain.qzv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me, thanks so much @gibsramen!!!
Closes #496
New workflow "Empress Standalone CI" that creates a non-QIIME2 environment and runs tests that do not require and QIIME2 dependencies.
test_cli
updated to not use the Artifact API.