Skip to content
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

Integration tests #24

Draft
wants to merge 43 commits into
base: develop
Choose a base branch
from
Draft

Integration tests #24

wants to merge 43 commits into from

Conversation

aburrell
Copy link
Collaborator

Scope

This pull request more fully shows the changes needed to bring the unit and integration tests up to standards. Namely it:

  • moves the tests to their expected location inside of the module; necessary for some testing imports
  • harnesses the strength of the data classes to remove test duplication
  • uses a common set of test files for unit and integration tests
  • uses a single test suite

This branch is a follow on from #9 and partially addresses #8.

Approval

Number of approvals: number of approvals before one can merge the code

Test

Run unit/integration tests using python3 -m unittest discover from either the test directory or the main module directory.

*Reminder, please check your code is:

  • copyrighted (if applicable)
  • Appropriate disclaimer added
  • Modification line filled in (if applicable)*

Note

As I no longer have the time or funding to work on this code, this has been added as a draft PR to encourage someone else to finish addressing Issue #8. Feel free to contact me if needed. This is not ready to be merged, #9 needs to be finished first. This note wrt my funding and time also applies to #8.

Added a missing definition of `long_description`, allowing setup.py to run.
Added autosaves to the list of files for git to ignore.
Updated the unit tests in TestSDarnRead by combining similar unit tests with
subtest, ensuring file structure works for all operating systems, and only
skipping test class if test file directory is missing.
Updated DarnUtilities unit tests by:
- using setup/teardown for common variables,
- replacing pytest skip with unittest skip,
- used subTest to combine common tests,
- fixed implementation of exception tests, and
- removed name call at end of file.
Fixed incorrect case in `pyDARNio` imports.
Fixed incorrect case in pyDARNio import.
Fixed incorrect case in pyDARNio import and improved PEP8 spacing.
Fixed bugs in testable unit tests, removed unnecessary skip, and fixed import statements.
Replaced deprecated `tostring` with `tobytes`.
Updated write_rawacf to include the correct class structures.
Updated test_superdarn by:
- fixing subTest implementation,
- removing unnecessary skips,
- removing duplicate tests in SDarnWrite class, and
- using setUp and tearDown in SDarnWrite class.
Created a routine to retrieve the desired test filenames.
Updated error message to fix formatting and add missing whitespace.
Fixed incorrect import of pyDARNio.
Created a common test class for pyDARNio file reading, reducing duplicate code in test_superdarn and test_dmap.
Moved `tfile_utils` to `file_utils`, since it's a better name.  Also updated `get_test_files` to retrieve the Borealis test files.
Created a common test writing class for SDarn and Dmap writing class unit tests.
Fixed bugs in unit test caused by:
- typos and
- incorrect attribute definition.
Changed pydarn import to pyDARNio import.
Updated test_conversions to:
- import pyDARNio correctly,
- include a tearDown function,
- use local class attributes in helper functions,
- use subTest, and
- remove the unnecessary __name__ statement at the end of the file.
Added a TestReadBorealis class that reduces the duplication found in the previous Borealis reading unit testing classes.
Used more robust method of obtaining a list from keys.
Created a BorealisWrite generic class, but is not currently working for unknown reasons.
Consolidated Borealis test classes:
- placed in their own utility file,
- removed duplicate tests using subTest, and
- ensure all version/structure combos are run using test classes.
unittest discover requires the presence of `__init__.py` files to find the test scripts.
Changed testing structure to remove duplicated files by:
- creating a testing module with the utilities and data sets,
- combining data sets from similar files, and
- moving the testing routines into the pyDARNio module, as is common practice.
Started the construction of a new test class for integration testing of SuperDARN reading and writing functionality.
Updated file_utils by:
- fixing bug in writing function and
- adding two stream tests to the TestReadWrite class.
Added classes for SuperDARN/Dmap Read/Write integration tests.  Removed the former tests now covered by these classes.
aburrell and others added 8 commits October 8, 2020 10:06
Moved the remaining SuperDARN integration tests
to their appropriate classes.
Applied style changes from linter.
Fixed some bugs from the integration tests.
Stream is not always a kwarg, but it is always a parameter after the filename.
Fixed failures in the updated SuperDARN integration tests.
The array evalutation is failing because one method is reading in the shape transposed.
pyDARNio/tests/__init__.py Outdated Show resolved Hide resolved
pyDARNio/tests/integration/test_superdarn.py Outdated Show resolved Hide resolved
pyDARNio/tests/integration/test_superdarn.py Outdated Show resolved Hide resolved
pyDARNio/tests/integration/test_superdarn.py Outdated Show resolved Hide resolved
pyDARNio/tests/integration/test_superdarn.py Outdated Show resolved Hide resolved
pydarnio/borealis/base_format.py Outdated Show resolved Hide resolved
pyDARNio/tests/utils/file_utils.py Outdated Show resolved Hide resolved
pyDARNio/tests/utils/file_utils.py Outdated Show resolved Hide resolved
pyDARNio/tests/utils/file_utils.py Outdated Show resolved Hide resolved
pyDARNio/tests/utils/file_utils.py Outdated Show resolved Hide resolved
aburrell and others added 3 commits June 28, 2021 17:04
Fixed pyDARNio imports.
Added more suggestions.
Fixed remaining pyDARNio imports.
Comment on lines +55 to +56
self.dmap_records = \
[OrderedDict([('stid', DmapScalar('stid', 1, 3, 'i')),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should break on open bracket rather than using \

@@ -0,0 +1,12 @@
#!/usr/bin/env python
# Copyright (C) 2020
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
# Copyright (C) 2020

pyDARNio/tests/utils/borealis_utils.py Outdated Show resolved Hide resolved
pyDARNio/tests/utils/data_sets/__init__.py Outdated Show resolved Hide resolved
@@ -268,3 +268,93 @@
43.419353], dtype=np.float32), data_type=4, data_type_fmt='f', dimension=1, shape=[6])),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This won't pass flake8

NRL not allowed to have a copyright.
NRL not allowed to have a copyright.
@RemingtonRohel
Copy link
Collaborator

@alexchartier I am directing you here as a continuation of issue #27 . This pull request seems to me like the place to add a testing procedure as per the issue, but I think some work needs to be done here first to get to that stage. I have no idea what the state of this PR is, but this comment should serve as a reminder for whoever picks this PR up (likely me at some point) to add a testing routine for the test cases discussed in #27 .

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.

None yet

2 participants