Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce number of running containers in CI to one per run #1406

Open
jkaflik opened this issue Sep 12, 2024 · 4 comments
Open

Reduce number of running containers in CI to one per run #1406

jkaflik opened this issue Sep 12, 2024 · 4 comments
Labels
enhancement tests Tests coverage related issues

Comments

@jkaflik
Copy link
Contributor

jkaflik commented Sep 12, 2024

Observed

Each CI tests run creates a few ClickHouse containers per test directory. This is an unnecessary overhead that could be reduced to a single container per run.

Expected behaviour

Run a single ClickHouse container per tests run.

@jkaflik jkaflik added enhancement tests Tests coverage related issues labels Sep 12, 2024
@romanchechyotkin
Copy link

romanchechyotkin commented Dec 27, 2024

hello, have you thought about running docker container in CI and make connections to this clickhouse container?

PS, ooohh, also i should have ability to run locally, my bad....

@jkaflik
Copy link
Contributor Author

jkaflik commented Dec 30, 2024

CI is using running ClickHouse in container.

@romanchechyotkin
Copy link

romanchechyotkin commented Dec 31, 2024

i meant use services https://docs.github.com/en/actions/use-cases-and-examples/using-containerized-services/about-service-containers
in tests we just connect to container running during CI, also we can mark tests with tag, which are using clickhouse for testing

i had such experience

integration-test:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:16.3
        env:
          POSTGRES_DB: postgres
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: 5432
        ports:
          - 5432:5432
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install Go
        uses: actions/setup-go@v4
        with:
          go-version: '1.22'
          cache: true

      - name: Build
        run: |
          go mod tidy
          go build ./...

      - name: Test
        env:
          CONFIG_PATH: ${{ github.workspace }}/config.yaml
        run: CGO_ENABLED=1 go test ./... -v -race -tags=integration

@jkaflik
Copy link
Contributor Author

jkaflik commented Jan 2, 2025

@romanchechyotkin no, as it's going for specific CI runners. We expect the test to be run with go test without any other requirements. Thus, test spawns container itself.

We don't want to maintain two ways of running dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement tests Tests coverage related issues
Projects
None yet
Development

No branches or pull requests

2 participants