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

Add NOTES.test #74

Open
jeanconn opened this issue Jul 30, 2015 · 3 comments
Open

Add NOTES.test #74

jeanconn opened this issue Jul 30, 2015 · 3 comments

Comments

@jeanconn
Copy link
Contributor

I had tried to run the py.test from top level instead of from kadi/tests . Add a NOTES.test to cover this.

No cmds.find() ?

This is testing on master (and does not appear to be due to recent merges).

dska-fido: py.test
===================================== test session starts =====================================
platform linux2 -- Python 2.7.9 -- py-1.4.26 -- pytest-2.6.4
collected 13 items 

test_cmds.py F
kadi/tests/test_events.py ..........
kadi/tests/test_occweb.py ..

========================================== FAILURES ===========================================
_________________________________________ test_ingest _________________________________________

    def test_ingest():
        """
        Test that doing the ingest a day at a time (which is the normal operational
        scenario) gives the same result as a one-time bulk ingest.  The latter is
        "easier" because there are no intermediate deletes and re-inserts.
        """

        # Some funkiness to be able to use two different data root values
        # within the same python session.  Inject the correct PATH and make
        # sure the LazyVals will re-read.
        data_root_tmp = Ska.File.TempDir()
        data_root = data_root_tmp.name
        update_cmds.main(['--start', '2011:340', '--stop', '2012:100',
                          '--data-root', data_root])

        # Some chicken-n-egg
        os.environ['KADI'] = os.path.abspath(data_root)
        from kadi.cmds import cmds

        # Reset
        if hasattr(cmds.idx_cmds, '_val'):
            del cmds.idx_cmds._val
        if hasattr(cmds.pars_dict, '_val'):
            del cmds.pars_dict._val

>       cmds_at_once = cmds.find('2012:010', '2012:090')
E       AttributeError: 'module' object has no attribute 'find'

test_cmds.py:41: AttributeError
@taldcroft
Copy link
Member

That's true, but formally this is not part of the unit tests. The procedure calls for cd kadi/tests prior to running py.test .

I'm leaving this issue open as a reminder to add this to unit tests for cmds. My initial 10 second try (change find to filter) failed as it just hangs after collecting the test.

@jeanconn
Copy link
Contributor Author

On Thu, Jul 30, 2015 at 3:42 PM, Tom Aldcroft [email protected]
wrote:

That's true, but formally this is not part of the unit tests. The
procedure calls for cd kadi/tests prior to running py.test .

Ah. Should that be in NOTES.test or some such in kadi (or did I just miss
it)? I was just trying to check out our current PRs and it didn't occur to
me to leave the kadi project and go to our skare notes for how to test kadi.

@taldcroft
Copy link
Member

A NOTES.test would be good, but I do regularly use our Skare tests as the reference for how to test any particular project. Kinda sad, I know.

@jeanconn jeanconn changed the title Test failure on lack of cmds.find() Add NOTES.test Sep 10, 2015
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

No branches or pull requests

2 participants