Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/constant/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ package constant

const (
Compose = "compose"
ComposeCommand = "docker-compose"
ComposeCommand = "docker compose"
)
18 changes: 18 additions & 0 deletions test/e2e/collect-expected.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Apache Software Foundation (ASF) licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

collected: "true"
Comment thread
wu-sheng marked this conversation as resolved.
21 changes: 21 additions & 0 deletions test/e2e/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ setup:
cleanup:
# always never success failure
on: always
# Exercise the compose log collector in CI so a regression to Docker Compose v1 is
# caught: GitHub-hosted runners ship only Compose v2, so the collector must use
# `docker compose`. Auto-collect is off here; the verify case below invokes
# `e2e collect` explicitly and asserts a file was collected.
collect:
on: never
output-dir: /tmp/e2e-collect-check
items:
- service: httpbin
paths:
- /etc/hostname

verify:
# verify with retry strategy
Expand Down Expand Up @@ -56,3 +67,13 @@ verify:
query: './bin/linux/e2e verify -c ./test/e2e/concurrency/non-fail-fast/internal/verify.yaml --summary-only -o yaml'
expected: ./concurrency/non-fail-fast/expected.yaml

# Guards the compose log collector against a regression to Docker Compose v1
# (which is absent on GitHub-hosted runners). Runs `e2e collect` against the
# already-running compose stack and asserts a container file was collected.
- name: compose log collector works on Docker Compose v2
query: |
rm -rf /tmp/e2e-collect-check
./bin/linux/e2e collect -c ./test/e2e/e2e.yaml > /dev/null 2>&1 || true
if [ -s /tmp/e2e-collect-check/httpbin/etc/hostname ]; then echo 'collected: "true"'; else echo 'collected: "false"'; fi
expected: ./collect-expected.yaml

Loading