confluentinc / confluentinc/kafka-tutorials
Tutorial validation: use `-B` when doing a diff between expected/actual output
- Dominant language
- Java
- Stars
- 39
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Description
See https://github.com/confluentinc/kafka-tutorials/pull/579 for more context.
When I build the `window-final-result` tutorial locally, it appears to succeed locally but ultimately fails because the diff isn't exactly -- there are blank lines:
```
cat tutorial-steps/dev/expected-count.txt
5
1
1
2
```
versus
```
cat tutorial-steps/dev/outputs/actual-count.txt
5
1
1
2
```
So this check fails:
```
[16:10:12] ~/git/kafka-tutorials/_includes/tutorials/window-final-result/kstreams/code(GH-461) ✗: bash -c 'diff --strip-trailing-cr <(cat tutorial-steps/dev/expected-count.txt) <(cat tutorial-steps/dev/outputs/actual-count.txt)'
4a5,7
>
>
>
[16:10:20] ~/git/kafka-tutorials/_includes/tutorials/window-final-result/kstreams/code(GH-461) ✗: echo $?
1
```
But this check passes (Notice the addition of the `-B` flag):
```
[16:10:22] ~/git/kafka-tutorials/_includes/tutorials/window-final-result/kstreams/code(GH-461) ✗: bash -c 'diff -B --strip-trailing-cr <(cat tutorial-steps/dev/expected-count.txt) <(cat tutorial-steps/dev/outputs/actual-count.txt)'
[16:10:35] ~/git/kafka-tutorials/_includes/tutorials/window-final-result/kstreams/code(GH-461) ✗: echo $?
0
```
Contributor guide
Assessment
This issue has not been assessed yet.