Uh oh!
There was an error while loading. Please reload this page.
Mock Scanner, instead of scan the computer running the test. - #3173
Conversation
GabrielBrascher
commented
Feb 11, 2019
Ping for review @kiwiflyer@nathanejohnson@DaanHoogland and others. |
Still getting failures on mac: |
This allows non linux machines to run the tests without scanning for a non existing /proc/meminfo.
b4dcd9a to
b83a172CompareGabrielBrascher
commented
Feb 11, 2019
Updated the code with a setup method and removed a variable that I left without mocking. Thanks for testing @nathanejohnson. Could you please test it again to make sure that it has been fixed? |
nathanejohnson
commented
Feb 11, 2019
still getting failures, but in a new place. I've attached logs |
GabrielBrascher
commented
Feb 12, 2019
@blueorangutan package |
blueorangutan
commented
Feb 12, 2019
@GabrielBrascher a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Feb 12, 2019
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2609 |
GabrielBrascher
commented
Feb 12, 2019
@blueorangutan test |
blueorangutan
commented
Feb 12, 2019
@GabrielBrascher a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
@nathanejohnson that is good. At least this PR fixed the test failures from |
DaanHoogland
commented
Feb 12, 2019
MemStatTest passes @GabrielBrascher . The following remains: |
blueorangutan
commented
Feb 12, 2019
Trillian test result (tid-3404)
|
yadvr
commented
Mar 26, 2019
Is this good to merge @GabrielBrascher@wido ? |
@rhtyd I submitted some additions to @GabrielBrascher . I hope these can be included in this PR: CLDIN#3 |
* powermock costructor for libvirt wrappers * run test only on linux, don't assume we're on linux * import
GabrielBrascher
commented
Mar 29, 2019
@rhtyd @DaanHoogland I updated the branch with the changes proposed by Daan. |
DaanHoogland
commented
Apr 3, 2019
@nathanejohnson can you give this a test, please? #worksforme |
DaanHoogland
commented
Apr 3, 2019
travis test run 7 always seems to fail, lately :( |
GabrielBrascher
commented
Apr 23, 2019
@DaanHoogland yes, test 7 has been failing constantly, not only in this PR. #3267 looks like a fix for the Travis-CI timeout. |
GabrielBrascher
commented
Apr 23, 2019
@nathanejohnson are you ok with this PR? |
nathanejohnson
commented
Apr 23, 2019
@GabrielBrascher sorry for the late response, builds on my machine now! LGTM! |
This allows computers with Windows or MacOS to run the tests without scanning for
/proc/meminfopath.At the class MemStat.java, the
refresh()method (called in MemStat constructor) has the following lines:When executing
Scanner scanner = new Scanner(f,"UTF-8")it scans the file MEMINFO_FILE (/proc/meminfo); however, if the OS running this test is not a Linux then it throwsFileNotFoundException, failing the test.Thus, by Mocking the Scanner constructor, the
new Scanner(f,"UTF-8")execution returns the desired Scanner.Description
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?