Merge pull request #7530 from kzys/critest-ginkgo-v2
This commit is contained in:
commit
e8cdbee1e6
21
.github/workflows/ci.yml
vendored
21
.github/workflows/ci.yml
vendored
@ -404,13 +404,14 @@ jobs:
|
||||
}
|
||||
critest.exe --runtime-endpoint=npipe://.//pipe//containerd-containerd --test-images-file='${{env.CRI_TEST_IMAGES}}' --report-dir='${{github.workspace}}/critestreport' $skip
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: TestResults ${{ matrix.os }}
|
||||
path: |
|
||||
${{github.workspace}}/*-junit.xml
|
||||
${{github.workspace}}/*-gotest.json
|
||||
${{github.workspace}}/report/*.log
|
||||
|
||||
integration-linux:
|
||||
name: Linux Integration
|
||||
@ -532,10 +533,15 @@ jobs:
|
||||
ENABLE_CRI_SANDBOXES: ${{ matrix.enable_cri_sandboxes }}
|
||||
run: |
|
||||
BDIR="$(mktemp -d -p $PWD)"
|
||||
mkdir -p ${{github.workspace}}/report
|
||||
|
||||
function cleanup() {
|
||||
sudo pkill containerd || true
|
||||
cat ${BDIR}/containerd-cri.log
|
||||
|
||||
echo ::group::containerd logs
|
||||
cat ${{github.workspace}}/report/containerd.log
|
||||
echo ::endgroup::
|
||||
|
||||
sudo -E rm -rf ${BDIR}
|
||||
}
|
||||
trap cleanup EXIT
|
||||
@ -547,9 +553,9 @@ jobs:
|
||||
runtime_type = "${TEST_RUNTIME}"
|
||||
EOF
|
||||
sudo ls /etc/cni/net.d
|
||||
sudo -E PATH=$PATH /usr/local/bin/containerd -a ${BDIR}/c.sock --config ${BDIR}/config.toml --root ${BDIR}/root --state ${BDIR}/state --log-level debug &> ${BDIR}/containerd-cri.log &
|
||||
sudo -E PATH=$PATH /usr/local/bin/containerd -a ${BDIR}/c.sock --config ${BDIR}/config.toml --root ${BDIR}/root --state ${BDIR}/state --log-level debug &> ${{github.workspace}}/report/containerd.log &
|
||||
sudo -E PATH=$PATH /usr/local/bin/ctr -a ${BDIR}/c.sock version
|
||||
sudo -E PATH=$PATH critest --report-dir "${{github.workspace}}/critestreport" --runtime-endpoint=unix:///${BDIR}/c.sock --parallel=8
|
||||
sudo -E PATH=$PATH critest --report-dir "${{github.workspace}}/report" --runtime-endpoint=unix:///${BDIR}/c.sock --parallel=8
|
||||
|
||||
# Log the status of this VM to investigate issues like
|
||||
# https://github.com/containerd/containerd/issues/4969
|
||||
@ -560,14 +566,15 @@ jobs:
|
||||
mount
|
||||
df
|
||||
losetup -l
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: TestResults ${{ matrix.runtime }} ${{matrix.runc}}
|
||||
path: |
|
||||
*-junit.xml
|
||||
*-gotest.json
|
||||
${{github.workspace}}/critestreport/*.xml
|
||||
${{github.workspace}}/report/*.xml
|
||||
${{github.workspace}}/report/*.log
|
||||
|
||||
tests-mac-os:
|
||||
name: MacOS unit tests
|
||||
@ -593,7 +600,7 @@ jobs:
|
||||
if: always()
|
||||
- run: script/test/test2annotation.sh *-gotest.json
|
||||
if: always()
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: TestResults MacOS
|
||||
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -46,7 +46,7 @@ jobs:
|
||||
working-directory: src/github.com/containerd/containerd
|
||||
|
||||
- name: Save release notes
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: containerd-release-notes
|
||||
path: src/github.com/containerd/containerd/release-notes.md
|
||||
@ -116,7 +116,7 @@ jobs:
|
||||
env:
|
||||
PLATFORM: ${{ matrix.dockerfile-platform }}
|
||||
- name: Save Artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: release-tars-${{env.PLATFORM_CLEAN}}
|
||||
path: src/github.com/containerd/containerd/releases/*.tar.gz*
|
||||
|
2
Makefile
2
Makefile
@ -220,7 +220,7 @@ bin/cri-integration.test:
|
||||
|
||||
cri-integration: binaries bin/cri-integration.test ## run cri integration tests (example: FOCUS=TestContainerListStats make cri-integration)
|
||||
@echo "$(WHALE) $@"
|
||||
@bash -x ./script/test/cri-integration.sh
|
||||
@bash ./script/test/cri-integration.sh
|
||||
@rm -rf bin/cri-integration.test
|
||||
|
||||
# build runc shimv2 with failpoint control, only used by integration test
|
||||
|
@ -23,6 +23,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/containerd/containerd/log/logtest"
|
||||
"github.com/containerd/containerd/pkg/cri/constants"
|
||||
"github.com/containerd/containerd/platforms"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
@ -61,7 +62,7 @@ var (
|
||||
// buildLocalContainerdClient is to return containerd client with initialized
|
||||
// core plugins in local.
|
||||
func buildLocalContainerdClient(t *testing.T, tmpDir string) *containerd.Client {
|
||||
ctx := context.Background()
|
||||
ctx := logtest.WithT(context.Background(), t)
|
||||
|
||||
// load plugins
|
||||
loadPluginOnce.Do(func() {
|
||||
|
@ -37,6 +37,7 @@ import (
|
||||
"github.com/containerd/containerd/content"
|
||||
"github.com/containerd/containerd/leases"
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/containerd/containerd/log/logtest"
|
||||
"github.com/containerd/containerd/namespaces"
|
||||
criconfig "github.com/containerd/containerd/pkg/cri/config"
|
||||
criserver "github.com/containerd/containerd/pkg/cri/server"
|
||||
@ -79,7 +80,7 @@ func testCRIImagePullTimeoutByHoldingContentOpenWriter(t *testing.T) {
|
||||
criService, err := initLocalCRIPlugin(cli, tmpDir, criconfig.Registry{})
|
||||
assert.NoError(t, err)
|
||||
|
||||
ctx := namespaces.WithNamespace(context.Background(), k8sNamespace)
|
||||
ctx := namespaces.WithNamespace(logtest.WithT(context.Background(), t), k8sNamespace)
|
||||
contentStore := cli.ContentStore()
|
||||
|
||||
// imageIndexJSON is the manifest of ghcr.io/containerd/volume-ownership:2.1.
|
||||
@ -241,7 +242,7 @@ func testCRIImagePullTimeoutByNoDataTransferred(t *testing.T) {
|
||||
err = os.WriteFile(filepath.Join(hostCfgDir, "hosts.toml"), []byte(hostTomlContent), 0600)
|
||||
assert.NoError(t, err)
|
||||
|
||||
ctx := namespaces.WithNamespace(context.Background(), k8sNamespace)
|
||||
ctx := namespaces.WithNamespace(logtest.WithT(context.Background(), t), k8sNamespace)
|
||||
for idx, registryCfg := range []criconfig.Registry{
|
||||
{
|
||||
ConfigPath: filepath.Dir(hostCfgDir),
|
||||
|
@ -1 +1 @@
|
||||
v1.24.1
|
||||
v1.25.0
|
||||
|
@ -59,7 +59,17 @@ ${CMD} --test.run="${FOCUS}" --test.v \
|
||||
--containerd-bin="${CONTAINERD_BIN}" \
|
||||
--image-list="${TEST_IMAGE_LIST:-}" && test_exit_code=$? || test_exit_code=$?
|
||||
|
||||
test $test_exit_code -ne 0 && \
|
||||
cat "$REPORT_DIR/containerd.log"
|
||||
if [[ "$test_exit_code" -ne 0 ]]; then
|
||||
if [[ -e "$GITHUB_WORKSPACE" ]]; then
|
||||
mkdir -p "$GITHUB_WORKSPACE/report"
|
||||
mv "$REPORT_DIR/containerd.log" "$GITHUB_WORKSPACE/report"
|
||||
|
||||
echo ::group::containerd logs
|
||||
cat "$GITHUB_WORKSPACE/report/containerd.log"
|
||||
echo ::endgroup::
|
||||
else
|
||||
cat "$REPORT_DIR/containerd.log"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit ${test_exit_code}
|
||||
|
Loading…
Reference in New Issue
Block a user