Mock Scanner, instead of scan the computer running the test.#3173
Mock Scanner, instead of scan the computer running the test.#3173DaanHoogland merged 3 commits intoapache:masterfrom
Conversation
|
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
b83a172
Compare
|
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? |
|
still getting failures, but in a new place. I've attached logs |
|
@blueorangutan package |
|
@GabrielBrascher a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2609 |
|
@blueorangutan test |
|
@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 |
|
MemStatTest passes @GabrielBrascher . The following remains: |
|
Trillian test result (tid-3404)
|
|
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
|
@rhtyd @DaanHoogland I updated the branch with the changes proposed by Daan. |
|
@nathanejohnson can you give this a test, please? #worksforme |
|
travis test run 7 always seems to fail, lately :( |
|
@DaanHoogland yes, test 7 has been failing constantly, not only in this PR. #3267 looks like a fix for the Travis-CI timeout. |
|
@nathanejohnson are you ok with this PR? |
|
@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?