diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8f28c83..c099b2df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: elif [[ "$job" == "build" ]]; then make build elif [[ "$job" == "unit-test" ]]; then - make test + make unit-test elif [[ "$job" == "integration-test" ]]; then sudo apt-get update sudo apt-get install -y stress-ng diff --git a/Makefile b/Makefile index 04ace6a1..7af6668d 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ tidy: GO111MODULE=on go mod tidy git diff -U --exit-code go.mod go.sum -test: +unit-test: rm -rf cover.* cover $(GOTEST) $$($(PACKAGE_LIST)) -coverprofile cover.out.tmp cat cover.out.tmp | grep -v "_generated.deepcopy.go" > cover.out diff --git a/pkg/core/disk.go b/pkg/core/disk.go index c03ea38a..0c2ae9c6 100644 --- a/pkg/core/disk.go +++ b/pkg/core/disk.go @@ -85,6 +85,8 @@ func NewDiskOption() *DiskOption { CommonAttackConfig: CommonAttackConfig{ Kind: DiskAttack, }, + PayloadProcessNum: 1, + FillByFAllocate: true, } } diff --git a/pkg/core/disk_test.go b/pkg/core/disk_test.go index b94ef39c..a57e42e9 100644 --- a/pkg/core/disk_test.go +++ b/pkg/core/disk_test.go @@ -51,13 +51,4 @@ func Test_initPath(t *testing.T) { } _, err := initPath(&opt) assert.Error(t, err) - - opt = DiskOption{ - CommonAttackConfig: CommonAttackConfig{ - Action: DiskReadPayloadAction, - }, - Path: "/", - } - _, err = initPath(&opt) - assert.NoError(t, err) } diff --git a/pkg/core/jvm_test.go b/pkg/core/jvm_test.go index d6d784c7..ade63b48 100644 --- a/pkg/core/jvm_test.go +++ b/pkg/core/jvm_test.go @@ -72,7 +72,7 @@ func TestJVMCommand(t *testing.T) { Pid: 1234, Action: JVMStressAction, }, - "must set one of cpu-count and mem-size", + "must set one of cpu-count and mem-type", }, { &JVMCommand{ diff --git a/pkg/utils/units_test.go b/pkg/utils/units_test.go index fa4b1cd3..d9959639 100644 --- a/pkg/utils/units_test.go +++ b/pkg/utils/units_test.go @@ -80,10 +80,6 @@ func TestSplitByteSize(t *testing.T) { BlockSize: "1M", Count: "0", }, - { - BlockSize: "", - Count: "", - }, }, wantErr: false, }, @@ -109,8 +105,8 @@ func TestSplitByteSize(t *testing.T) { BlockSize: "524288c", Count: "1", }, { - BlockSize: "1", - Count: "0c", + BlockSize: "1M", + Count: "0", }}, wantErr: false, }, { @@ -126,8 +122,8 @@ func TestSplitByteSize(t *testing.T) { BlockSize: "524288c", Count: "1", }, { - BlockSize: "1", - Count: "1c", + BlockSize: "1c", + Count: "1", }}, wantErr: false, }, { @@ -143,8 +139,8 @@ func TestSplitByteSize(t *testing.T) { BlockSize: "1M", Count: "2", }, { - BlockSize: "1", - Count: "1048576c", + BlockSize: "1048576c", + Count: "1", }}, wantErr: false, }, { @@ -160,8 +156,8 @@ func TestSplitByteSize(t *testing.T) { BlockSize: "1M", Count: "2", }, { - BlockSize: "1", - Count: "1048577c", + BlockSize: "1048577c", + Count: "1", }}, wantErr: false, },