Skip to content

Add openmetricstest parse positive and negative test cases#167

Merged
robskillington merged 4 commits intomasterfrom
robskillington/add-parse-tests
Nov 24, 2020
Merged

Add openmetricstest parse positive and negative test cases#167
robskillington merged 4 commits intomasterfrom
robskillington/add-parse-tests

Conversation

@robskillington
Copy link
Copy Markdown
Contributor

This adds positive and negative parse test cases from the Prometheus python client to openmetricstest and a helper to run the test cases against the Prometheus python client using docker.

Copy link
Copy Markdown
Contributor

@brian-brazil brian-brazil left a comment

Choose a reason for hiding this comment

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

This looks to be missing the roundtrip, plus prometheus/client_python#602

CI is also not happy.

# TYPE a gauge
# HELP a help
a 1
# EOF
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you sure there's no newline here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks good:

$ xxd tests/testdata/parsers/no_newline_after_eof/metrics.txt
00000000: 2320 5459 5045 2061 2067 6175 6765 0a23  # TYPE a gauge.#
00000010: 2048 454c 5020 6120 6865 6c70 0a61 2031   HELP a help.a 1
00000020: 0a23 2045 4f46                           .# EOF
$ xxd tests/testdata/parsers/simple_counter/metrics.txt
00000000: 2320 5459 5045 2061 2063 6f75 6e74 6572  # TYPE a counter
00000010: 0a23 2048 454c 5020 6120 6865 6c70 0a61  .# HELP a help.a
00000020: 5f74 6f74 616c 2031 0a23 2045 4f46 0a    _total 1.# EOF.

@robskillington robskillington force-pushed the robskillington/add-parse-tests branch from 2b7aed2 to 32fb905 Compare November 24, 2020 04:33
@robskillington
Copy link
Copy Markdown
Contributor Author

Added the roundtrip test and updated with latest changes from prometheus/client_python#602 @brian-brazil 👍

@brian-brazil
Copy link
Copy Markdown
Contributor

👍

@robskillington robskillington merged commit e4d21f4 into master Nov 24, 2020
@robskillington robskillington deleted the robskillington/add-parse-tests branch November 24, 2020 14:47
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