Details
Description
Assuming meta info
Meta: @environment all @skip
the following filter may not exclude the scenario, although it should:
-environment preview -skip
Method match in MetaFilter returns immediately when one filter expression does not match. If "environment" is tested before "skip", match will return false, and scenario will not be excluded. The logic should be changed such that match will return true, iff any exclusion filter matches.
The actual order of evaluation depends on the order of property names returned by #getPropertyNames, which appears to be alphabetical.
private boolean match(Properties properties, Meta meta) { for (Object key : properties.keySet()) { String property = (String) properties.get(key); for (String metaName : meta.getPropertyNames()) { if (key.equals(metaName)) { String value = meta.getProperty(metaName); if (StringUtils.isBlank(value)) { return true; } else if (property.contains("*")) { return value.matches(property.replace("*", ".*")); } return properties.get(key).equals(value); } } } return false; }
Activity
Dennis Homann
made changes -
Field | Original Value | New Value |
---|---|---|
Attachment | MetaFilterReproducerTest.java [ 56481 ] |
Mauro Talevi
made changes -
Fix Version/s | 3.5 [ 17393 ] |
Mauro Talevi
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Assignee | Mauro Talevi [ maurotalevi ] | |
Resolution | Fixed [ 1 ] |
Attached reproducing test case