Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #1794 - Fix for tags not being honored in karate-gatling #1796

Merged
merged 1 commit into from Oct 8, 2021

Conversation

packleader
Copy link
Contributor

Description

KarateFeatureAction makes a copy of protocol.runner and then sets the tags on that copy. In order to honor the tags, we need to pass the copy to Runner.callAsync rather than the original protocol.runner.

I have validated that the fix works by following the steps I documented in #1794.

@packleader
Copy link
Contributor Author

packleader commented Oct 8, 2021

This is a critical bugfix for my team. We need to be able to set multiple tags using karateFeature("path", "@tagOne", "@tagTwo"), so #1794 is preventing us from upgrading from v0.9.6.

If possible, we'd like to ask that this fix be included in v1.1.1 or v1.2.0. Thank you.

@ptrthomas ptrthomas changed the base branch from master to develop October 8, 2021 03:48
@ptrthomas
Copy link
Member

@packleader PRs have to be against develop so I've switched it.

I'd need more investigation. the protocol.runner part was introduced specifically to solve for "unifying" the Runner, refer #1622

not sure if protocol.runner.tags() gets you what you want or it becomes "global, but I think we tried to make it different for each karateFeature()

this may not be relevant since you want multiple tags, but karateFeature('some.feature@foo') should work for a single tag

@packleader
Copy link
Contributor Author

Thanks for fixing the target branch. I always forget that part.

I agree that karateFeature('some.feature@foo') will work. However, we have several existing test cases that use karateFeature('some.feature', '@foo', '@bar'). They broke when we upgraded from 0.9.6 to 1.1.0.

I'll admit that I don't fully understand how the Protocol and Runner work. But it seems odd that we create val runner = protocol.runner.copy() but then don't really use it. We call a few setters on it, but that's all. It seems to me that we should either do:

    val runner = protocol.runner.copy()
    runner.callSingleCache(protocol.callSingleCache)
    runner.callOnceCache(protocol.callOnceCache)
    runner.tags(tags.asJava)

    Runner.callAsync(runner, name, callArg, perfHook)

or:

    protocol.runner.callSingleCache(protocol.callSingleCache)
    protocol.runner.callOnceCache(protocol.callOnceCache)
    protocol.runner.tags(tags.asJava)

    Runner.callAsync(protocol.runner, name, callArg, perfHook)

@ptrthomas ptrthomas merged commit bfd532e into karatelabs:develop Oct 8, 2021
@ptrthomas
Copy link
Member

@packleader thank you ! that helped, and I must have missed switching to the "cloned" runner.

@packleader packleader deleted the bugfix-1794 branch November 12, 2021 20:17
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.

None yet

2 participants