Skip to content

Fix flaky test for apikey info by id#3495

Merged
simitt merged 1 commit intoelastic:masterfrom
simitt:fix-apikey-test
Mar 17, 2020
Merged

Fix flaky test for apikey info by id#3495
simitt merged 1 commit intoelastic:masterfrom
simitt:fix-apikey-test

Conversation

@simitt
Copy link
Copy Markdown
Contributor

@simitt simitt commented Mar 17, 2020

Motivation/summary

When passing an argument value that starts with a dash to a CLI tool it will be interpreted as a flag instead of a string value, e.g. -xyz would be interpreted as --xyz, when passed in as e.g.
--id -xyz instead of --id=-xyz.
Instead of running ./apm-server apikey info --id -DB06HAB0_bchW-gz4zt it should be run as ./apm-server apikey info --id="-DB06HAB0_bchW-gz4zt".

This PR adapts the python system tests accordingly to avoid test flakyness wherever a value that might start with a dash is passed in to the apikey tests.

Checklist

- [ ] I have signed the Contributor License Agreement.
- [ ] My code follows the style guidelines of this project (run make check-full for static code checks and linting)

  • I have rebased my changes on top of the latest master branch

- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works

  • New and existing unit tests pass locally with my changes

- [ ] I have updated CHANGELOG.asciidoc

How to test these changes

Related issues

fixes #3298

Ensure that IDs are treated as string values and not as flags when
starting with a dash.

fixes elastic#3298
@simitt simitt requested a review from a team March 17, 2020 16:10
@simitt simitt merged commit c50360b into elastic:master Mar 17, 2020
simitt added a commit to simitt/apm-server that referenced this pull request Mar 17, 2020
Ensure that IDs are treated as string values and not as flags when
starting with a dash.

fixes elastic#3298
simitt added a commit that referenced this pull request Mar 18, 2020
Ensure that IDs are treated as string values and not as flags when
starting with a dash.

fixes #3298
@jalvz
Copy link
Copy Markdown
Contributor

jalvz commented Mar 18, 2020

oh my... :/ thanks for fixing

@simitt simitt deleted the fix-apikey-test branch March 18, 2020 16:41
axw added a commit to axw/apm-server that referenced this pull request Aug 11, 2020
Ensure API Keys beginning with hyphens are not
interpreted as CLI flags. See elastic#3495
axw added a commit that referenced this pull request Aug 11, 2020
Ensure API Keys beginning with hyphens are not
interpreted as CLI flags. See #3495
axw added a commit to axw/apm-server that referenced this pull request Sep 7, 2020
Ensure API Keys beginning with hyphens are not
interpreted as CLI flags. See elastic#3495
axw added a commit that referenced this pull request Sep 7, 2020
Ensure API Keys beginning with hyphens are not
interpreted as CLI flags. See #3495
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.

Fix flaky APIKeyTest test_invalidate_by_id

3 participants