Skip to content

Commit

Permalink
upgrade: bump critest and k8s e2e test to 1.14
Browse files Browse the repository at this point in the history
temporary skip critest: 'runtime should support execSync with timeout'

Signed-off-by: zhuangqh <zhuangqhc@gmail.com>
  • Loading branch information
zhuangqh authored and rudyfly committed Jun 21, 2019
1 parent d4ba492 commit a43bd5f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
28 changes: 19 additions & 9 deletions daemon/logger/crilog/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,36 @@ func redirectLogs(path string, w io.Writer, r io.ReadCloser, stream streamType)
partialBytes := []byte(runtime.LogTagPartial)
fullBytes := []byte(runtime.LogTagFull)
br := bufio.NewReaderSize(r, bufSize)
stop := false

for {
lineBytes, isPrefix, err := br.ReadLine()
lineBytes, err := br.ReadBytes(eol)
tagBytes := fullBytes
if err != nil {
if err == io.EOF {
logrus.Infof("finish redirecting log file(name=%v)", path)
} else {
if err != io.EOF {
logrus.WithError(err).Errorf("failed to redirect log file(name=%v)", path)
return
}
return
}
tagBytes := fullBytes
if isPrefix {
logrus.Infof("finish redirecting log file(name=%v)", path)

if len(lineBytes) == 0 {
return
}

// the last line without the eol is treated as a partial log.
tagBytes = partialBytes
stop = true
}

timestampBytes := time.Now().AppendFormat(nil, time.RFC3339Nano)
data := bytes.Join([][]byte{timestampBytes, streamBytes, tagBytes, lineBytes}, delimiterBytes)
data = append(data, eol)

if _, err := w.Write(data); err != nil {
logrus.Errorf("failed to write %q log to log file: %v", stream, err)
}

if stop {
break
}
}
}
2 changes: 1 addition & 1 deletion hack/install/install_critest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

CRITEST_BRANCH_DEFAULT=release-1.12
CRITEST_BRANCH_DEFAULT=master

# keep the first one only
GOPATH="${GOPATH%%:*}"
Expand Down
4 changes: 2 additions & 2 deletions hack/testing/run_daemon_cri_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ integration::run_daemon_cri_test_e2e_cases() {
local cri_runtime code KUBERNETES_VERSION
cri_runtime=$1

KUBERNETES_VERSION="release-1.12"
KUBERNETES_VERSION="release-1.14"
KUBERNETES_REPO="github.com/kubernetes/kubernetes"
KUBERNETES_PATH="${GOPATH}/src/k8s.io/kubernetes"
if [ ! -d "${KUBERNETES_PATH}" ]; then
if [[ ! -d "${KUBERNETES_PATH}" ]]; then
mkdir -p "${KUBERNETES_PATH}"
cd "${KUBERNETES_PATH}"
git clone https://${KUBERNETES_REPO} .
Expand Down
1 change: 1 addition & 0 deletions hack/testing/run_daemon_cri_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export PATH="${GOPATH}/bin:${PATH}"

# CRI_SKIP skips the test to skip.
DEFAULT_CRI_SKIP="should error on create with wrong options"
DEFAULT_CRI_SKIP+="|runtime should support execSync with timeout"
CRI_SKIP="${CRI_SKIP:-"${DEFAULT_CRI_SKIP}"}"

# CRI_FOCUS focuses the test to run.
Expand Down

0 comments on commit a43bd5f

Please sign in to comment.