GithubHelp home page GithubHelp logo

Doesn't compile on windows about gopsutil HOT 6 CLOSED

shirou avatar shirou commented on June 18, 2024
Doesn't compile on windows

from gopsutil.

Comments (6)

vrecan avatar vrecan commented on June 18, 2024

I will have a PR up soon to fix this

from gopsutil.

vrecan avatar vrecan commented on June 18, 2024

Also noticed a decent amount of the tests fail in windows

=== RUN TestReadlines
--- PASS: TestReadlines (0.00s)
=== RUN TestReadLinesOffsetN
import (
--- PASS: TestReadLinesOffsetN (0.00s)
=== RUN TestIntToString
--- PASS: TestIntToString (0.00s)
=== RUN TestByteToString
--- PASS: TestByteToString (0.00s)
=== RUN TestStringsContains
--- PASS: TestStringsContains (0.00s)
=== RUN TestPathExists
--- PASS: TestPathExists (0.00s)
PASS
ok      github.com/shirou/gopsutil/common       0.024s
# github.com/shirou/gopsutil/process
process\process_test.go:246: p.CreateTime undefined (type Process has no field or method CreateTime)
=== RUN TestCpu_times
--- PASS: TestCpu_times (0.00s)
=== RUN TestCpu_counts
--- PASS: TestCpu_counts (0.00s)
=== RUN TestCPUTimeStat_String
--- PASS: TestCPUTimeStat_String (0.00s)
=== RUN TestCpuInfo
--- PASS: TestCpuInfo (1.06s)
=== RUN TestCPUPercent
--- FAIL: TestCPUPercent (3.07s)
        cpu_test.go:82: error wmi: cannot load field "LoadPercentage" into a "uint16": unsupported type (<nil>)
        cpu_test.go:82: error wmi: cannot load field "LoadPercentage" into a "uint16": unsupported type (<nil>)
=== RUN TestCPUPercentPerCpu
--- FAIL: TestCPUPercentPerCpu (3.07s)
        cpu_test.go:82: error wmi: cannot load field "LoadPercentage" into a "uint16": unsupported type (<nil>)
FAIL
FAIL    github.com/shirou/gopsutil/cpu  7.235s
FAIL    github.com/shirou/gopsutil/disk [build failed]
?       github.com/shirou/gopsutil/docker       [no test files]
=== RUN TestHostInfo
--- PASS: TestHostInfo (0.33s)
=== RUN TestBoot_time
--- PASS: TestBoot_time (0.00s)
=== RUN TestUsers
--- PASS: TestUsers (0.00s)
=== RUN TestHostInfoStat_String
--- PASS: TestHostInfoStat_String (0.00s)
=== RUN TestUserStat_String
--- PASS: TestUserStat_String (0.00s)
PASS
ok      github.com/shirou/gopsutil/host 0.381s
=== RUN TestLoad
--- FAIL: TestLoad (0.00s)
        load_test.go:11: error not implemented yet
=== RUN TestLoadAvgStat_String
--- PASS: TestLoadAvgStat_String (0.00s)
FAIL
FAIL    github.com/shirou/gopsutil/load 0.030s
=== RUN TestVirtual_memory
--- PASS: TestVirtual_memory (0.00s)
=== RUN TestSwap_memory
--- PASS: TestSwap_memory (0.00s)
=== RUN TestVirtualMemoryStat_String
--- PASS: TestVirtualMemoryStat_String (0.00s)
=== RUN TestSwapMemoryStat_String
--- PASS: TestSwapMemoryStat_String (0.00s)
PASS
ok      github.com/shirou/gopsutil/mem  0.044s
=== RUN TestAddrString
--- PASS: TestAddrString (0.00s)
=== RUN TestNetIOCountersStatString
--- PASS: TestNetIOCountersStatString (0.00s)
=== RUN TestNetConnectionStatString
--- PASS: TestNetConnectionStatString (0.00s)
=== RUN TestNetIOCountersAll
--- PASS: TestNetIOCountersAll (0.00s)
=== RUN TestNetIOCountersPerNic
--- PASS: TestNetIOCountersPerNic (0.00s)
=== RUN Test_getNetIOCountersAll
--- PASS: Test_getNetIOCountersAll (0.00s)
=== RUN TestNetInterfaces
--- PASS: TestNetInterfaces (0.00s)
PASS
ok      github.com/shirou/gopsutil/net  0.025s
FAIL    github.com/shirou/gopsutil/process [build failed]

from gopsutil.

shirou avatar shirou commented on June 18, 2024

Thank you the PR. I have merged just now!
And also, I will check test failures later.

from gopsutil.

shirou avatar shirou commented on June 18, 2024

I fixed some process test failures on Windows. Could you check it out?
However, many func is not implemented. "Not implemented" error is fine right now on Windows.

from gopsutil.

vrecan avatar vrecan commented on June 18, 2024

looks good now, only fails are from ones logging not implemented. Could we change the tests to only run if they are on the supported os? Or would that be annoying to maintain?

from gopsutil.

shirou avatar shirou commented on June 18, 2024

Test failed by 'not implemented' is not a problem, at least for me. That is a good indicator of implementation status I think.

Tests can be changed to be skipped if not implemented os. But it makes a little bit hard to understand why the returned value is not set.

I closed this issue. If you have any issue, feel free to re-open.

Thank you!

from gopsutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.