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 simple test #28

Closed
wants to merge 2 commits into from
Closed

Add simple test #28

wants to merge 2 commits into from

Conversation

hanslovsky
Copy link
Member

Simple tests so far:

  • test resolution for
    • auto
    • copy
    • hard
    • soft
  • test parsington with argument 1+3

Should be merged only after #26 as it builds on top of the commits in #26.

@hanslovsky
Copy link
Member Author

I am trying to figure out what the travies files should look like.

This is what I have for travis.yml:

language: python
jdk: oraclejdk8
python:
  - "3.6"
  - "3.7"
branches:
  only:
  - master
  - "/.*-[0-9]+\\..*/"
install: true
script: ".travis/build.sh"
cache:
  directories:
  - "~/.m2/repository"

And this is what I have for .travis/build.sh:

python setup.py test
pip install . --user

@hanslovsky
Copy link
Member Author

@ctrueden I tried to check the travis ci locally but it did not work for me. Should we just merge and then fix the travis ci config if necessary?

@hanslovsky
Copy link
Member Author

Fixed the merge conflicts introduced in #30

Simple tests so far:
 - test resolution for
   - auto
   - copy
   - hard
   - soft
 - test parsington with argument `1+3`
@ctrueden
Copy link
Member

I rebased this over the latest master, fixing the conflicts. So this PR became a single commit adding the test suite as well as the stdout+stderr arguments to various functions. Hopefully I did it right.

I then pushed a commit adding the Travis CI configuration.

Unfortunately, one of the tests is failing for me locally:

$ python setup.py test
running test
Searching for nose>=1.0
Best match: nose 1.3.7
Processing nose-1.3.7-py3.7.egg

Using /Users/curtis/code/scijava/jgo/.eggs/nose-1.3.7-py3.7.egg
running egg_info
writing jgo.egg-info/PKG-INFO
writing dependency_links to jgo.egg-info/dependency_links.txt
writing entry points to jgo.egg-info/entry_points.txt
writing top-level names to jgo.egg-info/top_level.txt
reading manifest file 'jgo.egg-info/SOURCES.txt'
writing manifest file 'jgo.egg-info/SOURCES.txt'
running build_ext
test_resolve_auto (test_parsington.ParsingtonTest) ... ok
test_resolve_copy (test_parsington.ParsingtonTest) ... ok
test_resolve_hard (test_parsington.ParsingtonTest) ... ok
test_resolve_soft (test_parsington.ParsingtonTest) ... ok
test_run_jgo (test_parsington.ParsingtonTest) ... ERROR

======================================================================
ERROR: test_run_jgo (test_parsington.ParsingtonTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/curtis/code/scijava/jgo/tests/test_parsington.py", line 95, in test_run_jgo
    self.assertEqual(completed_process.returncode, 0, 'Expected return code zero.')
AttributeError: 'NoneType' object has no attribute 'returncode'
-------------------- >> begin captured logging << --------------------
jgo: DEBUG: Setting cache dir from environment: /var/folders/n2/5q09bjq11kv6xwpp0xlg4npc0000gq/T/jgo-test-cache-dirz0taq8nj
jgo: DEBUG: Using settings:      {'m2repo': '/Users/curtis/.m2/repository', 'cachedir': '/var/folders/n2/5q09bjq11kv6xwpp0xlg4npc0000gq/T/jgo-test-cache-dirz0taq8nj', 'links': 'auto'}
jgo: DEBUG: Using respositories: {}
jgo: DEBUG: Using shortcuts:     {}
jgo: DEBUG: Returning expanded coordinate org.scijava:parsington:1.0.4.
jgo: DEBUG: Relevant maven output: [INFO]    org.scijava:parsington:jar:1.0.4:compile
jgo: DEBUG: Linking source /Users/curtis/.m2/repository/org/scijava/parsington/1.0.4/parsington-1.0.4.jar to target /var/folders/n2/5q09bjq11kv6xwpp0xlg4npc0000gq/T/jgo-test-cache-dirz0taq8nj/org/scijava/parsington/1.0.4/parsington-1.0.4.jar with link_type auto
jgo: DEBUG: Linking source /Users/curtis/.m2/repository/org/scijava/parsington/1.0.4/parsington-1.0.4.jar to target /var/folders/n2/5q09bjq11kv6xwpp0xlg4npc0000gq/T/jgo-test-cache-dirz0taq8nj/org/scijava/parsington/1.0.4/parsington-1.0.4.jar with link_type hard
jgo: DEBUG: class path: /var/folders/n2/5q09bjq11kv6xwpp0xlg4npc0000gq/T/jgo-test-cache-dirz0taq8nj/org/scijava/parsington/1.0.4/*
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 5 tests in 11.639s

FAILED (errors=1)
Test failed: <unittest.runner.TextTestResult run=5 errors=1 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=5 errors=1 failures=0>

And Travis is reporting the same failure as well. Also, the pip install . --user command bombs.

@hanslovsky
Copy link
Member Author

The tests worked locally for me after fixing the merge issues. Should we restore from my local branch?

@ctrueden
Copy link
Member

@hanslovsky Maybe just look at the patch above and see if anything jumps out at you? It's not that complicated. I may have simply done something wrong in the merge. You could also see if this branch now works for you locally as well.

@hanslovsky
Copy link
Member Author

The test does not run locally. I figure the fastest way forward is to force-push my local branch again but without any travis files.

@ctrueden
Copy link
Member

@hanslovsky Please push it to a different branch. Then I will diff it against this one.

@hanslovsky
Copy link
Member Author

I can do that but I am bit puzzled why you did not do that in the first place.

@hanslovsky
Copy link
Member Author

@hanslovsky hanslovsky mentioned this pull request Jan 14, 2019
@hanslovsky
Copy link
Member Author

Close in favor of #32

@hanslovsky hanslovsky closed this Jan 14, 2019
@ctrueden ctrueden deleted the add-simple-test branch April 30, 2019 15:56
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