Skip to content

Update ideogram tests.#280

Merged
mkcor merged 7 commits intomasterfrom
update-ideogram-tests
Mar 29, 2019
Merged

Update ideogram tests.#280
mkcor merged 7 commits intomasterfrom
update-ideogram-tests

Conversation

@mkcor
Copy link
Contributor

@mkcor mkcor commented Mar 28, 2019

Adresses #260.

About

Certain integration tests count (expected) elements by having Selenium find them (CSS selector). Sometimes, the underlying function times out before updated elements could be found and, hence, counted.

Description of changes

Delving into the Ideogram tests, I have standardized the finding / counting of elements. I have pushed frequently to have 'statistics' on CI test failures, and lately they haven't failed... So I'm thinking of not changing

-    chromosomes = wait_for_elements_by_css_selector(driver, '.chromosome')
+    chromosomes = wait_for_elements_by_css_selector(driver, '.chromosome', timeout=20.0)

(at least, not yet).

Before merging

@mkcor
Copy link
Contributor Author

mkcor commented Mar 28, 2019

PS: Letting the plotly dependency be >=3.5.0 (in practice, I'm now running the latest version 3.7.1) doesn't seem to change anything. I have explored the demo apps locally. There's still this error in the console when accessing Dash Alignment Viewer:

TypeError: the JSON object must be str, bytes or bytearray, not NoneType

* eukaryote. The Ideogram component can be used to compare
* homologous features between chromosomes, and depict
* haploid, diploid, aneuploidy genomes. It can also display
* haploid, diploid, aneuploid genomes. It can also display
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Words like these make me remember why I switched my major from biochem 🤣

# assert 22 chromosomes + X and Y chromosomes
num_chromosoms = len(wait_for_elements_by_css_selector(driver, '.chromosome'))
assert num_chromosoms == 24
chromosomes = wait_for_elements_by_css_selector(driver, '.chromosome')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason that you changed these? (I'm just wondering if it somehow speeds things up, or ensures that we have a result before trying to test the assertion)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is to standardize the tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For both reasons: standardize and get elements before taking their length (for possible debugging too).

# assert the presence of homology region
regions = wait_for_elements_by_css_selector(driver, '.syntenicRegion')
assert len(regions) != 0
assert len(regions) > 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed? I guess it makes sense, since the length of a list cannot be negative, but I'm not sure this change affects performance or functionality. (Correct me if I'm wrong!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't affect performance or functionality, but if ever a length was negative, I would want to catch it!! Well, I'm for writing the meaningful version directly (we expect this length to be positive, so let's write it, it's easier on the reader too).

Copy link
Contributor

@Bachibouzouk Bachibouzouk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃

@mkcor mkcor merged commit 38b55a3 into master Mar 29, 2019
@mkcor mkcor deleted the update-ideogram-tests branch March 29, 2019 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants