1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-05-02 22:17:08 +08:00

Merge pull request #997 from shirou/feature/remove_circle_ci

remove circleci testing
This commit is contained in:
shirou 2020-11-19 22:57:46 +09:00 committed by GitHub
commit 340db113de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 64 deletions

View File

@ -1,58 +0,0 @@
version: 2.1
jobs:
test:
docker:
- image: circleci/golang:1.14
working_directory: /home/circleci/go/src/github.com/shirou/gopsutil
environment:
GOPATH: /home/circleci/go
steps:
- run:
command: |
echo -e 'export PATH=$GOPATH/bin:$PATH' >> $BASH_ENV
source /home/circleci/.bashrc
- checkout
- run:
command: make init_tools
- run:
command: dep ensure
- run:
command: make vet
- run:
command: make build_test
macos:
macos:
xcode: "10.2.0"
environment:
GOPATH: /Users/distiller/go
GOVERSION: "1.13.8"
steps:
- checkout
- run:
command: |
curl -O https://dl.google.com/go/go${GOVERSION}.darwin-amd64.pkg
sudo installer -pkg go${GOVERSION}.darwin-amd64.pkg -target /
- run:
command: |
make init_tools
mkdir -p ${GOPATH}/src/github.com/shirou/
mv /Users/distiller/project /Users/distiller/go/src/github.com/shirou/gopsutil
- run:
command: |
export PATH=$GOPATH/bin:$PATH
cd /Users/distiller/go/src/github.com/shirou/gopsutil && dep ensure
- run:
command: |
cd /Users/distiller/go/src/github.com/shirou/gopsutil && go build -v
- run:
command: |
cd /Users/distiller/go/src/github.com/shirou/gopsutil && make macos_test
workflows:
version: 2
test:
jobs:
- macos
- test

View File

@ -4,7 +4,7 @@ jobs:
test_v3_module:
strategy:
matrix:
go-version: [1.12.x, 1.14.x, 1.15.x]
go-version: [1.13.x, 1.14.x, 1.15.x]
os: [ubuntu-18.04, ubuntu-16.04, windows-2019, windows-2016, macOS-10.14, macos-11.0]
runs-on: ${{ matrix.os }}
steps:
@ -50,7 +50,7 @@ jobs:
GO111MODULE: off
strategy:
matrix:
go-version: [1.12.x, 1.14.x, 1.15.x]
go-version: [1.13.x, 1.14.x, 1.15.x]
os: [ubuntu-18.04, ubuntu-16.04, windows-2019, windows-2016, macOS-10.14, macos-11.0]
runs-on: ${{ matrix.os }}
steps:

View File

@ -1,8 +1,9 @@
gopsutil: psutil for golang
==============================
.. image:: https://circleci.com/gh/shirou/gopsutil.svg?&style=shield
:target: https://circleci.com/gh/shirou/gopsutil
.. image:: https://github.com/shirou/gopsutil/workflows/Test/badge.svg
:target: https://github.com/shirou/gopsutil/actions?query=workflow%3ATest
.. image:: https://coveralls.io/repos/shirou/gopsutil/badge.svg?branch=master
:target: https://coveralls.io/r/shirou/gopsutil?branch=master

View File

@ -2,6 +2,7 @@ package net
import (
"fmt"
"math"
"os"
"runtime"
"testing"
@ -86,7 +87,7 @@ func TestNetIOCountersAll(t *testing.T) {
for _, p := range per {
pr += p.PacketsRecv
}
if v[0].PacketsRecv != pr {
if math.Abs(float64(v[0].PacketsRecv-pr)) > 5 {
t.Errorf("invalid sum value: %v, %v", v[0].PacketsRecv, pr)
}
}

View File

@ -2,6 +2,7 @@ package net
import (
"fmt"
"math"
"os"
"runtime"
"testing"
@ -86,7 +87,8 @@ func TestNetIOCountersAll(t *testing.T) {
for _, p := range per {
pr += p.PacketsRecv
}
if v[0].PacketsRecv != pr {
// small diff is ok
if math.Abs(float64(v[0].PacketsRecv-pr)) > 5 {
t.Errorf("invalid sum value: %v, %v", v[0].PacketsRecv, pr)
}
}