Skip to content

Commit

Permalink
WIP: test for e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
chendave committed Nov 19, 2019
1 parent c6a5aa7 commit 2a3aa3a
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 68 deletions.
131 changes: 67 additions & 64 deletions .travis.yml
Expand Up @@ -10,13 +10,13 @@ services:
go:
- 1.12

before_install:
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md)|(\.png)|(\.pdf)|(\.html)|^(LICENSE)|^(docs)'
then
echo "Only doc files were updated, skip running the CI."
exit
fi
#before_install:
# - |
# if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md)|(\.png)|(\.pdf)|(\.html)|^(LICENSE)|^(docs)'
# then
# echo "Only doc files were updated, skip running the CI."
# exit
# fi

before_script:
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | BINARY=golangci-lint sh -s -- -d -b $(go env GOPATH)/bin v1.20.0
Expand All @@ -36,71 +36,74 @@ install: true

jobs:
include:
- stage: "Verify vendor"
script: make verify
name: "check if the vendor is up to date"
# - stage: "Verify vendor"
# script: make verify
# name: "check if the vendor is up to date"

- stage: "Test lint"
script: make cloud_lint
name: "cloud_lint"
- script: make bluetoothdevice_lint
name: "bluetooth_device_lint"
- script: make keadm_lint
name: "keadm_lint"
- script: make edge_lint
name: "edge_lint"
# - stage: "Test lint"
# script: make cloud_lint
# name: "cloud_lint"
# - script: make bluetoothdevice_lint
# name: "bluetooth_device_lint"
# - script: make keadm_lint
# name: "keadm_lint"
# - script: make edge_lint
# name: "edge_lint"

- stage: "Test Build"
script: make
arch: amd64
name: "builds cloud and edge components on amd64"
- script: make bluetoothdevice
arch: amd64
name: "build bluetooth_device on amd64"
- script: make edge_small_build
arch: amd64
name: "build small edge version on amd64"
- script: make edge_cross_build
name: "cross build edge"
- script: make edge_cross_build_v7
name: "cross build edge for armv7"
- script: make edgesite_cross_build
name: "cross build edgesite"
- script: make edgesite_cross_build_v7
name: "cross build edgeite for armv7"
# - stage: "Test Build"
# script: make
# arch: amd64
# name: "builds cloud and edge components on amd64"
# - script: make bluetoothdevice
# arch: amd64
# name: "build bluetooth_device on amd64"
# - script: make edge_small_build
# arch: amd64
# name: "build small edge version on amd64"
# - script: make edge_cross_build
# name: "cross build edge"
# - script: make edge_cross_build_v7
# name: "cross build edge for armv7"
# - script: make edgesite_cross_build
# name: "cross build edgesite"
# - script: make edgesite_cross_build_v7
# name: "cross build edgeite for armv7"

- stage: "unit tests"
script: make edge_test
arch: amd64
name: "unit test edge on amd64"
- script: make edge_integration_test
arch: amd64
name: "integration test edgeo on amd64"
- script: make cloud_test
arch: amd64
name: "unit test cloud on amd64"

- stage: "e2e tests"
script: make e2e_test
arch: amd64
name: "e2e_test on amd64"
- script: make edge_test
arch: arm64
name: "unit test edge on arm64"
# - script: make edge_integration_test
# arch: amd64
# name: "integration test edge on amd64"
# - script: make cloud_test
# arch: amd64
# name: "unit test cloud on amd64"

- stage: "build docker images"
script: make cloudimage
arch: amd64
name: "build cloudimage on amd64"
- script: make admissionimage
arch: amd64
name: "build admission image on amd64"
- script: make edgeimage ARCH="amd64"
arch: amd64
name: "build edge image on amd64"
- script: make edgesiteimage ARCH="amd64"
arch: amd64
name: "build edgesite image on amd64"
- script: make bluetoothdevice_image
arch: amd64
name: "build bluetoothdevice image on amd64"
# - stage: "e2e tests"
# script: make e2e_test
# arch: amd64
# name: "e2e_test on amd64"
#
# - stage: "build docker images"
# script: make cloudimage
# arch: amd64
# name: "build cloudimage on amd64"
# - script: make admissionimage
# arch: amd64
# name: "build admission image on amd64"
# - script: make edgeimage ARCH="amd64"
# arch: amd64
# name: "build edge image on amd64"
# - script: make edgesiteimage ARCH="amd64"
# arch: amd64
# name: "build edgesite image on amd64"
# - script: make bluetoothdevice_image
# arch: amd64
# name: "build bluetoothdevice image on amd64"
# TODO: When the arm support of travis becomes stable, we will uncomment these cases.
# - script: make cloudimage
# arch: arm64
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Expand Up @@ -99,7 +99,8 @@ keadm_lint:
QEMU_ARCH ?= x86_64
ARCH ?= amd64

IMAGE_TAG ?= $(shell git describe --tags)
#IMAGE_TAG ?= $(shell git describe --tags)
IMAGE_TAG ?= latest

.PHONY: cloudimage
cloudimage:
Expand All @@ -126,6 +127,7 @@ edgeimage:

.PHONY: edgesiteimage
edgesiteimage:
$(info ARCH is $(ARCH))
mkdir -p ./build/edgesite/tmp
rm -rf ./build/edgesite/tmp/*
curl -L -o ./build/edgesite/tmp/qemu-${QEMU_ARCH}-static.tar.gz https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-${QEMU_ARCH}-static.tar.gz
Expand Down
3 changes: 2 additions & 1 deletion edge/Makefile
Expand Up @@ -19,7 +19,8 @@ endif

export GOARCHAIUS_CONFIG_PATH=$(CURDIR)
test:
find ${TEST_DIR} -name "*_test.go"| xargs -I{} dirname {} | uniq | xargs -I{} go test ${T} {}
#find ${TEST_DIR} -name "*_test.go"| xargs -I{} dirname {} | uniq | xargs -I{} go test ${T} {}
bash test.sh

# lint
.PHONY: lint
Expand Down
23 changes: 23 additions & 0 deletions edge/test.sh
@@ -0,0 +1,23 @@
#!/bin/bash

go test github.com/kubeedge/kubeedge/edge/pkg/eventbus/common/util
go test github.com/kubeedge/kubeedge/edge/pkg/devicetwin
go test github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dtmodule
go test github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dtcontext
go test github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dtcommon
go test github.com/kubeedge/kubeedge/edge/pkg/devicetwin
# has issue on ARM
go test github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dtmanager
go test github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dtclient
go test github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dttype
go test github.com/kubeedge/kubeedge/edge/pkg/common/dbm
go test github.com/kubeedge/kubeedge/edge/pkg/servicebus/util
#has issue on ARM
go test github.com/kubeedge/kubeedge/edge/pkg/edgehub/config
go test github.com/kubeedge/kubeedge/edge/pkg/edgehub
go test github.com/kubeedge/kubeedge/edge/pkg/edgehub/clients
go test github.com/kubeedge/kubeedge/edge/pkg/edgehub/clients/wsclient
go test github.com/kubeedge/kubeedge/edge/pkg/edgehub/common/http
go test github.com/kubeedge/kubeedge/edge/pkg/edgehub
go test github.com/kubeedge/kubeedge/edge/pkg/metamanager/dao
go test github.com/kubeedge/kubeedge/edge/pkg/metamanager
4 changes: 2 additions & 2 deletions pkg/util/flag/flags.go
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
@CHANGELOG
KubeEdge Authors: delete useless functions
KubeEdge Authors: delete useless functions.
*/

package flag
Expand All @@ -24,7 +24,7 @@ import (
"k8s.io/klog"
)

// PrintFlags logs the flags in the flagset
// PrintFlags logs the flags in the flagset.
func PrintFlags(flags *pflag.FlagSet) {
flags.VisitAll(func(flag *pflag.Flag) {
klog.V(1).Infof("FLAG: --%s=%q", flag.Name, flag.Value)
Expand Down

0 comments on commit 2a3aa3a

Please sign in to comment.