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

update numir.io test #21

Merged
merged 5 commits into from
Mar 6, 2018
Merged

update numir.io test #21

merged 5 commits into from
Mar 6, 2018

Conversation

ShigekiKarita
Copy link
Member

address the issues reported in #19

@ShigekiKarita
Copy link
Member Author

no numpy enviroment

$ dub test
Generating test runner configuration 'numir-test-library' for 'library' (library).
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Performing "unittest" build using ldc2 for x86_64.
mir-algorithm 0.6.21: target for configuration "library" is up to date.
mir-random 0.2.8: target for configuration "library" is up to date.
numir 0.0.7: building configuration "numir-test-library"...
Running pre-build commands...
Traceback (most recent call last):
  File "test_npy_fileio.py", line 1, in <module>
    import numpy
ImportError: No module named numpy
To force a rebuild of up-to-date targets, run again with --force.
Running ./numir-test-library 
WARNING: install numpy to test numir.io
WARNING: install numpy to test numir.io
All unit tests have been run successfully.

numpy installed environment

$ source ~/tool/anaconda3/bin/activate
$ dub test
Generating test runner configuration 'numir-test-library' for 'library' (library).
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Performing "unittest" build using ldc2 for x86_64.
mir-algorithm 0.6.21: target for configuration "library" is up to date.
mir-random 0.2.8: target for configuration "library" is up to date.
numir 0.0.7+commit.1.g7ecbc83: building configuration "numir-test-library"...
Running pre-build commands...
To force a rebuild of up-to-date targets, run again with --force.
Running ./numir-test-library 
All unit tests have been run successfully.

@ShigekiKarita ShigekiKarita requested a review from jmh530 December 9, 2017 09:21
@ShigekiKarita ShigekiKarita self-assigned this Dec 9, 2017
@jmh530
Copy link
Contributor

jmh530 commented Dec 11, 2017

@ShigekiKarita It looks like I still get a message about python not being installed, unless I make adjustments as before.

EDIT: Note that I did this with a plain dub test and after running cd test && python test.py ; cd ...

This is what I get when I run it:

C:\Users\user-name]\Documents\GitHub\numir>dub test
Package mir-algorithm can be upgraded from 0.6.15 to 0.6.21.
Package mir-random can be upgraded from 0.2.5 to 0.2.8.
Use "dub upgrade" to perform those changes.
Generating test runner configuration 'numir-test-library' for 'library' (library).
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Performing "unittest" build using dmd for x86.
mir-algorithm 0.6.15: building configuration "library"...
Running pre-build commands...
'python' is not recognized as an internal or external command,
operable program or batch file.
Command failed with exit code 1

@ShigekiKarita
Copy link
Member Author

Thank you. I will create my local windows D environment and solve this error on this weekend.

@jmh530
Copy link
Contributor

jmh530 commented Feb 22, 2018

@ShigekiKarita I can also try to reproduce it again tonight and see if it is still an issue.

@jmh530
Copy link
Contributor

jmh530 commented Feb 23, 2018

I just tried running dub test with master on Windows 10. I got some errors, but ran dub upgrade and then it looks like all tests passed after that

C:\Users\John Hall\Documents\GitHub\numir>dub test
Generating test runner configuration 'numir-test-library' for 'library' (library).
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Performing "unittest" build using dmd for x86.
mir-algorithm 0.9.2: building configuration "library"...
mir-linux-kernel 1.0.0: building configuration "library"...
mir-random 0.4.3: building configuration "library"...
numir 0.1.2+commit.6.g66d9d4a: building configuration "numir-test-library"...
Linking...
Running .\numir-test-library.exe
All unit tests have been run successfully.

@ShigekiKarita
Copy link
Member Author

I got very different error with dmd 2.078.3 😥 on Windows7

PS C:\Users\skarita\Downloads\numir> dub test --verbose --build=unittest-cov
Using dub registry url 'http://code.dlang.org/'
Refreshing local packages (refresh existing: true)...
Looking for local package map at C:\ProgramData\dub\packages\local-packages.json
Looking for local package map at C:\Users\skarita\AppData\Roaming\dub\packages\local-packages.json
Determined package version using GIT: numir 0.1.2+commit.17.gd45b9e6
Refreshing local packages (refresh existing: false)...
Looking for local package map at C:\ProgramData\dub\packages\local-packages.json
Looking for local package map at C:\Users\skarita\AppData\Roaming\dub\packages\local-packages.json
  Found dependency mir-algorithm 0.9.3
  Found dependency mir-random 0.4.3
    Found dependency mir-linux-kernel 1.0.0
Refreshing local packages (refresh existing: false)...
Looking for local package map at C:\ProgramData\dub\packages\local-packages.json
Looking for local package map at C:\Users\skarita\AppData\Roaming\dub\packages\local-packages.json
  Found dependency mir-algorithm 0.9.3
  Found dependency mir-random 0.4.3
    Found dependency mir-linux-kernel 1.0.0
Checking for upgrades.
Using cached upgrade results...
Generating test runner configuration 'numir-test-library' for 'library' (library).
Get module name from path: C:/Users/skarita/Downloads/numir/source/numir/core/creation.d
Get module name from path: C:/Users/skarita/Downloads/numir/source/numir/core/manipulation.d
Orphan format specifier: %s

@ShigekiKarita
Copy link
Member Author

I could run dub test on MSYS2 (Windows 7).


C:\Users\user-name]\Documents\GitHub\numir>dub test
Package mir-algorithm can be upgraded from 0.6.15 to 0.6.21.
Package mir-random can be upgraded from 0.2.5 to 0.2.8.
Use "dub upgrade" to perform those changes.
Generating test runner configuration 'numir-test-library' for 'library' (library).
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Performing "unittest" build using dmd for x86.
mir-algorithm 0.6.15: building configuration "library"...
Running pre-build commands...
'python' is not recognized as an internal or external command,
operable program or batch file.
Command failed with exit code 1

I found the problem is preBuildCommands

  • before cd test && python test_npy_fileio.py ; cd ..
  • after "cd test && python test_npy_fileio.py || true ; cd ..

This change allows to fail python test_npy_fileio.py and numir/io.d also skips tests if *.npy does not exist.

$ dub test
Selected package mir-algorithm 0.9.3 does not match the dependency specification >=0.4.3 <0.7.0 in package numir. Need to "dub upgrade"?
Selected package mir-random 0.4.3 does not match the dependency specification >=0.2.2 <0.3.0 in package numir. Need to "dub upgrade"?
Generating test runner configuration 'numir-test-library' for 'library' (library).
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Performing "unittest" build using C:\d\dmd2\windows\bin\dmd.exe for x86.
mir-algorithm 0.9.3: building configuration "library"...
Running pre-build commands...
Traceback (most recent call last):
  File "test_npy_fileio.py", line 1, in <module>
    import numpy
ImportError: No module named 'numpy'
mir-linux-kernel 1.0.0: building configuration "library"...
Running pre-build commands...
Traceback (most recent call last):
  File "test_npy_fileio.py", line 1, in <module>
    import numpy
ImportError: No module named 'numpy'
mir-random 0.4.3: building configuration "library"...
Running pre-build commands...
Traceback (most recent call last):
  File "test_npy_fileio.py", line 1, in <module>
    import numpy
ImportError: No module named 'numpy'
numir 0.0.7+commit.1.g7ecbc83: building configuration "numir-test-library"...
Running pre-build commands...
Traceback (most recent call last):
  File "test_npy_fileio.py", line 1, in <module>
    import numpy
ImportError: No module named 'numpy'
Linking...
Running .\numir-test-library.exe
WARNING: install numpy to test numir.io
WARNING: install numpy to test numir.io
All unit tests have been run successfully.

@ShigekiKarita
Copy link
Member Author

The travis-CI failure seems to be relevant with ddox's vibe-d issue vibe-d/vibe.d#2058

@codecov-io
Copy link

codecov-io commented Mar 5, 2018

Codecov Report

Merging #21 into master will decrease coverage by 0.15%.
The diff coverage is 96.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
- Coverage   99.92%   99.77%   -0.16%     
==========================================
  Files          10       10              
  Lines        1321     1325       +4     
==========================================
+ Hits         1320     1322       +2     
- Misses          1        3       +2
Impacted Files Coverage Δ
source/numir/io.d 98.43% <96.82%> (-1.57%) ⬇️

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 d45b9e6...1d46b0d. Read the comment docs.

@jmh530
Copy link
Contributor

jmh530 commented Mar 5, 2018

@ShigekiKarita I'm only seeing a codecov failure (which can be ignored). It looks like Travis is passing.

There's only one small change I would recommend. The warning
writeln("WARNING: install numpy to test numir.io");
could provide a little more detail, as in:
writeln("WARNING: Unittests for numir.io skipped because no installation of numpy detected. Install numpy to test numir.io");

@jmh530
Copy link
Contributor

jmh530 commented Mar 6, 2018

Ah, I see what you were talking about now. Nevermind.

@ShigekiKarita ShigekiKarita merged commit f60ceb4 into master Mar 6, 2018
@ShigekiKarita ShigekiKarita deleted the patch-io-test branch March 6, 2018 03:49
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