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

Reduce pocs test redundancy (and fix camera simulator) #681

Merged
merged 14 commits into from
Oct 6, 2018

Conversation

wtgee
Copy link
Member

@wtgee wtgee commented Oct 6, 2018

This changes and fixes a few things related to testing and the simulators:

  • Make sure camera simulator is always using temp dir, not just during testing.
  • Use a simulator.yaml targets file. We spend a lot of time loading the targets, especially in test_observatory.py. This reduces that a lot.
  • Combined some tests in test_pocs that were causing the entire POCS object to be created for simple property tests. Should keep same coverage.
  • Camera simulator exposure times reduced to 1s.

wtgee added 4 commits October 5, 2018 08:16
* Using simulator file for tests so we are not constantly loading a
bunch of targets
* Lots of shortening of tests so we are not constantly recreateing the
POCS instance when we don't need to
@wtgee wtgee changed the title Reduce pocs test redundancy Reduce pocs test redundancy (and fix camera simulator) Oct 6, 2018

# If POCSTIME is set for testing then the simulator will generate
# duplicate filenames each time so we pass a filename here. Full path
# is added in `camera._setup_obseravtion`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in _setup_obseravtion

pocs.base.reset_global_config()

global _one_time_config
if not _one_time_config:
_one_time_config = load_config(ignore_local=True, simulator=['all'])
_one_time_config['db']['name'] = 'panoptes_testing'
_one_time_config['directories']['images'] = images_dir
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this line execute often enough? Or should it indented less?

Copy link
Member Author

Choose a reason for hiding this comment

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

Would that be true of the db as well? Or because that is a global is it fine anyway?

@codecov
Copy link

codecov bot commented Oct 6, 2018

Codecov Report

Merging #681 into develop will increase coverage by 0.01%.
The diff coverage is 88.88%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #681      +/-   ##
===========================================
+ Coverage    77.98%   77.99%   +0.01%     
===========================================
  Files           61       61              
  Lines         5065     5068       +3     
  Branches       696      696              
===========================================
+ Hits          3950     3953       +3     
  Misses         900      900              
  Partials       215      215
Impacted Files Coverage Δ
pocs/utils/error.py 100% <100%> (ø) ⬆️
pocs/scheduler/scheduler.py 92.38% <100%> (-1.91%) ⬇️
pocs/camera/simulator.py 98.24% <75%> (-1.76%) ⬇️
pocs/camera/camera.py 89.41% <0%> (-0.53%) ⬇️
pocs/core.py 79.72% <0%> (ø) ⬆️
pocs/observatory.py 89.67% <0%> (ø) ⬆️
pocs/dome/protocol_astrohaven_simulator.py 80.34% <0%> (+0.85%) ⬆️
pocs/utils/images/__init__.py 65.19% <0%> (+0.98%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3746e5...edd1e4e. Read the comment docs.

@wtgee
Copy link
Member Author

wtgee commented Oct 6, 2018

@jamessynge this dropped covered on the astrohaven dome in an unexpected way. Can you maybe look over the coverage report before I merge to see if you have any concerns? Thanks!

Edit: I added two lines to the dome tests and increased coverage instead. :)

@wtgee wtgee merged commit 7c5819d into panoptes:develop Oct 6, 2018
@wtgee wtgee deleted the reduce-pocs-test-redundancy branch October 6, 2018 08:50
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.

2 participants