Skip to content

Commit

Permalink
[exporter/clickhouse] Update integration tests+readme (#31896)
Browse files Browse the repository at this point in the history
**Description:** Fixed code review nits leftover from #30209 

**Testing:**
- Added `clickhouse/clickhouse-server:24-alpine` to integration tests

**Documentation:**
- Added example command for running integration tests
  • Loading branch information
SpencerTorres authored Mar 21, 2024
1 parent 41a9700 commit 0097f69
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 32 deletions.
27 changes: 0 additions & 27 deletions .chloggen/add_integration_test_for_clickhous_exporter.yaml

This file was deleted.

12 changes: 10 additions & 2 deletions exporter/clickhouseexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ service:
exporters: [ clickhouse ]
```
## Developer tips
## Contributing
- Make sure integration tests pass after any change of sql
Before contributing, review the contribution guidelines in [CONTRIBUTING.md](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md).
#### Integration tests
Integration tests can be run with the following command:
```sh
go test -tags integration -run=TestIntegration
```
*Note: Make sure integration tests pass after making changes to SQL.*
6 changes: 3 additions & 3 deletions exporter/clickhouseexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/clickhouseexporter/internal/metadata"
)

// NewFactory creates a factory for Elastic exporter.
// NewFactory creates a factory for ClickHouse exporter.
func NewFactory() exporter.Factory {
return exporter.NewFactory(
metadata.Type,
Expand Down Expand Up @@ -47,7 +47,7 @@ func createDefaultConfig() component.Config {
}

// createLogsExporter creates a new exporter for logs.
// Logs are directly insert into clickhouse.
// Logs are directly inserted into ClickHouse.
func createLogsExporter(
ctx context.Context,
set exporter.CreateSettings,
Expand All @@ -73,7 +73,7 @@ func createLogsExporter(
}

// createTracesExporter creates a new exporter for traces.
// Traces are directly insert into clickhouse.
// Traces are directly inserted into ClickHouse.
func createTracesExporter(
ctx context.Context,
set exporter.CreateSettings,
Expand Down
4 changes: 4 additions & 0 deletions exporter/clickhouseexporter/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ func TestIntegration(t *testing.T) {
name string
image string
}{
{
name: "test clickhouse 24-alpine",
image: "clickhouse/clickhouse-server:24-alpine",
},
{
name: "test clickhouse 23-alpine",
image: "clickhouse/clickhouse-server:23-alpine",
Expand Down

0 comments on commit 0097f69

Please sign in to comment.