Skip to content

Commit

Permalink
Fix test config
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Mar 5, 2019
1 parent 3c56f8c commit 7bf013c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
5 changes: 2 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<Authors>@jet @eulerfx @eiriktsarpalis @michaelliao5 and contributors</Authors>
<Company>Jet.com</Company>
<Description>Lightweight F# wrapper for Confluent.Kafka</Description>
<PackageProjectUrl>https://github.com/jet/confluent-kafka-fsharp</PackageProjectUrl>
<PackageTags>kafka;fsharp</PackageTags>
<PackageProjectUrl>https://github.com/jet/Jet.ConfluentKafka.FSharp</PackageProjectUrl>
<PackageTags>kafka fsharp</PackageTags>
<PackageLicense>Apache-2.0</PackageLicense>
<Copyright>Copyright © 2016-9</Copyright>

Expand All @@ -31,5 +31,4 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Please note the [QuickStart](quickstart) is probably the best way to gain an ove

NB The tests are reliant on a `TEST_KAFKA_BROKER` environment variable pointing to a test environment that will auto-create ephemeral Kafka Topics as required by the tests (each test run writes to a guid-named topic)

### build, including tests
### build, including tests on net461 and netcoreapp2.1

dotnet build build.proj
dotnet build build.proj -v n

## FAQ

Expand Down
9 changes: 8 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
name: $(Rev:r)

# Summary:
# Linux: Tests with netcoreapp2.1 using docker Kafka instance
# net461 on Mono is not working, no investigation why as yet, but local run validates it
# Windows: Builds and emits nupkg as artifacts
# MacOS: Builds only

jobs:
- job: Windows
pool:
Expand Down Expand Up @@ -28,7 +35,7 @@ jobs:
ches/kafka
sleep 15
displayName: Docker kafka for integration tests
- script: dotnet test build.proj
- script: dotnet test build.proj -v n -p:TargetFrameworks=netcoreapp2.1 # net461 fails
displayName: Run Integration tests
env:
TEST_KAFKA_BROKER: localhost:9092
Expand Down
5 changes: 3 additions & 2 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@

<PrOption Condition =" '$(BUILD_PR)' != '%24(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)' ">/p:BUILD_PR=$(BUILD_PR) </PrOption>
<PackOptions>/p:BUILD_ID=$(BUILD_ID) $(PrOption) -o $(ThisDirAbsolute)bin/nupkg</PackOptions>

<TestOptions>--logger:trx</TestOptions>
<TestOptions Condition=" '$(TargetFrameworks)' != '' ">$(TestOptions) /p:TargetFrameworks=$(TargetFrameworks)</TestOptions>
</PropertyGroup>

<Target Name="Pack">
Expand All @@ -21,6 +22,6 @@
<Exec Command="dotnet test tests/Jet.ConfluentKafka.FSharp.Integration $(Cfg) $(TestOptions)" />
</Target>

<Target Name="Build" DependsOnTargets="VSTest;Pack" />
<Target Name="Build" DependsOnTargets="Pack;VSTest" />

</Project>
2 changes: 1 addition & 1 deletion src/Jet.ConfluentKafka.FSharp/ConfluentKafka.fs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ type KafkaProducer private (log: ILogger, producer : Producer<string, string>, t

static member Create(log : ILogger, config : KafkaProducerConfig, topic : string) =
if String.IsNullOrEmpty topic then nullArg "topic"
log.Information("Producing... {broker} / {topic} compression={compression} acks={acks}", config.Broker, topic, config.Compression, config.Acks)
log.Information("Producing... {broker} / {topic} compression={compression:l} acks={acks}", config.Broker, topic, config.Compression, config.Acks)
let producer =
ProducerBuilder<string, string>(config.Kvps)
.SetLogHandler(fun _p m -> log.Information("{message} level={level} name={name} facility={facility}", m.Message, m.Level, m.Name, m.Facility))
Expand Down

0 comments on commit 7bf013c

Please sign in to comment.