Skip to content

Ci/workflow - #2

Closed
lupodevelop wants to merge 5 commits into
mainfrom
ci/workflow
Closed

Ci/workflow#2
lupodevelop wants to merge 5 commits into
mainfrom
ci/workflow

Conversation

@lupodevelop

Copy link
Copy Markdown
Owner

This pull request introduces a comprehensive continuous integration (CI) and testing setup for the project, including GitHub Actions workflows for unit, smoke, and integration tests, as well as supporting documentation and configuration for local and CI-based testing. The changes ensure robust test coverage and provide clear instructions for contributors on running and organizing tests.

CI/CD Workflows and Automation:

  • Added .github/workflows/ci.yml to run unit tests, formatting checks, and builds on pushes and pull requests to main, ensuring code quality and correctness.
  • Introduced .github/workflows/smoke-integration.yml to perform fast smoke tests against a ClickHouse instance on every pull request, verifying basic connectivity and minimal API functionality.
  • Added .github/workflows/integration.yml for full integration tests against multiple ClickHouse versions, triggered on push or manually, to ensure compatibility and deeper correctness.

Testing Infrastructure and Documentation:

  • Added docker-compose.yml for spinning up a local ClickHouse service with test credentials, simplifying local and CI integration testing.
  • Created test/TESTS.md and test/integration/README.md to document the test structure, how to run tests locally or in CI, environment variables, and best practices for contributors. [1] [2]

Project Documentation Updates:

  • Updated README.md to include CI and integration test badges, a quick start example, and a clear overview of the project structure and testing approach.

These changes establish a solid foundation for reliable development, easier onboarding, and safer contributions.

Most important changes:

CI/CD and Test Automation

  • Added unit test workflow (ci.yml) for all pushes/PRs to main, running formatting, build, and test steps.
  • Added smoke integration workflow (smoke-integration.yml) for fast PR validation against ClickHouse.
  • Added comprehensive integration test workflow (integration.yml) with matrix testing against multiple ClickHouse versions.

Testing Infrastructure & Docs

  • Added docker-compose.yml for local/CI ClickHouse setup with test credentials and health checks.
  • Added test/TESTS.md and test/integration/README.md to explain test organization, local/CI execution, and environment configuration. [1] [2]

Project Documentation

  • Updated README.md with new CI badges, quick start, and clearer project/test structure overview.

Introduces TESTS.md with guidance on test directory structure, running unit and integration tests, and CI best practices. Adds integration/README.md detailing ClickHouse integration test setup, environment variables, and CI recommendations.
Introduces a docker-compose.yml to set up a ClickHouse server for testing, including environment variables, port mappings, persistent storage, and a healthcheck.
Introduces three GitHub Actions workflows: 'ci.yml' for unit tests and formatting on push and PRs, 'integration.yml' for matrix integration testing against multiple ClickHouse versions, and 'smoke-integration.yml' for basic smoke tests on pull requests. These workflows automate testing and validation for improved code quality and reliability.
Added CI and integration test badges, a Gleam version badge, and a new quick start section with example usage. Expanded documentation to clarify available modules and design inspiration.
Copilot AI review requested due to automatic review settings November 9, 2025 16:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive integration testing infrastructure and documentation for the Sparkling ClickHouse client library. It establishes a foundation for running integration tests both locally and in CI environments.

  • Introduces Docker Compose configuration for local ClickHouse testing
  • Adds three GitHub Actions workflows: unit tests (CI), full integration tests, and smoke tests for PRs
  • Provides detailed documentation on test organization, running tests locally, and CI guidance

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
test/integration/README.md Comprehensive documentation for running integration tests locally and in CI
test/TESTS.md Overview of test organization and structure across the repository
docker-compose.yml Docker Compose configuration for ClickHouse test instance
.github/workflows/ci.yml Main CI workflow for unit tests on PRs and main branch
.github/workflows/integration.yml Full integration test workflow with matrix testing across ClickHouse versions
.github/workflows/smoke-integration.yml Lightweight smoke tests for PRs using curl
README.md Updated with CI badges, quick start example, and module overview

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


This document explains how to run integration tests locally and how to wire them into CI in a safe way.

Prerequisites

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing markdown heading level indicator. This should be ## Prerequisites to maintain proper heading hierarchy.

Suggested change
Prerequisites
## Prerequisites

Copilot uses AI. Check for mistakes.
- Docker (used for the example below).
- docker-compose (optional, if you prefer a compose-based setup).

Recommended local setup (Docker Compose)

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing markdown heading level indicator. This should be ## Recommended local setup (Docker Compose) to maintain proper heading hierarchy.

Suggested change
Recommended local setup (Docker Compose)
## Recommended local setup (Docker Compose)

Copilot uses AI. Check for mistakes.
docker-compose down -v
```

Quick single-container alternative (no compose)

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing markdown heading level indicator. This should be ## Quick single-container alternative (no compose) to maintain proper heading hierarchy.

Suggested change
Quick single-container alternative (no compose)
## Quick single-container alternative (no compose)

Copilot uses AI. Check for mistakes.
docker stop clickhouse-server && docker rm clickhouse-server
```

Connection details (local defaults)

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing markdown heading level indicator. This should be ## Connection details (local defaults) to maintain proper heading hierarchy.

Suggested change
Connection details (local defaults)
## Connection details (local defaults)

Copilot uses AI. Check for mistakes.

If your tests require different credentials or endpoints, set the appropriate environment variables (see the `Environment variables` section below).

Implemented integration tests

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing markdown heading level indicator. This should be ## Implemented integration tests to maintain proper heading hierarchy.

Suggested change
Implemented integration tests
## Implemented integration tests

Copilot uses AI. Check for mistakes.
Comment thread test/TESTS.md
docker stop clickhouse-server && docker rm clickhouse-server
```

Environment variables

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing markdown heading level indicator. This should be ## Environment variables to maintain proper heading hierarchy.

Suggested change
Environment variables
## Environment variables

Copilot uses AI. Check for mistakes.
Comment thread test/TESTS.md

Document required variables in `test/integration/README.md`.

CI guidance

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing markdown heading level indicator. This should be ## CI guidance to maintain proper heading hierarchy.

Suggested change
CI guidance
## CI guidance

Copilot uses AI. Check for mistakes.
Comment thread test/TESTS.md
- Pull Requests: run unit tests only.
- Integration tests: run in separate CI jobs (manual trigger, nightly, or on release tags). Ensure the CI environment has access to required services and secrets before enabling integration jobs.

Best practices and PR checklist

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing markdown heading level indicator. This should be ## Best practices and PR checklist to maintain proper heading hierarchy.

Suggested change
Best practices and PR checklist
## Best practices and PR checklist

Copilot uses AI. Check for mistakes.
Comment thread README.md

## Quick start

See the extracted quick start example: `docs/quickstart.md` it contains a short walkthrough (define schema, build a query, execute it with a repo).

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing punctuation after docs/quickstart.md. Should be: 'See the extracted quick start example: docs/quickstart.md. It contains a short walkthrough (define schema, build a query, execute it with a repo).'

Suggested change
See the extracted quick start example: `docs/quickstart.md` it contains a short walkthrough (define schema, build a query, execute it with a repo).
See the extracted quick start example: `docs/quickstart.md`. It contains a short walkthrough (define schema, build a query, execute it with a repo).

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +44
if [ "$OUT" != '{"result":1}' ] && [ "$OUT" != '{"result":1}\n' ]; then
echo "Unexpected response: $OUT"
exit 2
fi

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The literal \\n check is incorrect. The newline comparison won't work as expected because $OUT from curl won't contain a literal \\n string. Consider using grep or checking the content without the newline: echo \"$OUT\" | grep -q '{\"result\":1}' or strip trailing whitespace before comparison.

Suggested change
if [ "$OUT" != '{"result":1}' ] && [ "$OUT" != '{"result":1}\n' ]; then
echo "Unexpected response: $OUT"
exit 2
fi
echo "$OUT" | grep -q '{"result":1}' || {
echo "Unexpected response: $OUT"
exit 2
}

Copilot uses AI. Check for mistakes.
Bump Gleam version from 1.6.1 to 1.11.0 in CI and integration workflows, update cache keys accordingly, and reflect the new minimum version in the README badge. Also add a step to display the Gleam version in workflows.
@lupodevelop lupodevelop closed this Nov 9, 2025
@lupodevelop
lupodevelop deleted the ci/workflow branch November 9, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants