Skip to content

Tutorial validation: use -B when doing a diff between expected/actual output #583

@ybyzek

Description

@ybyzek

See #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions