question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add tagging separate from string descriptions

See original GitHub issue

There is a clear distinction between describing a test and classifying it. They are semantically different things. The current method of ‘tagging’ or ‘marking’ tests is by patterns in the string descriptions. This not only mixes two things that probably shouldn’t be but also causes some usability issues.

Even just a couple ‘tags’ can drown out the test descriptions, especially since they have to be formatted for reliable parsing for text search. They don’t end up looking great in the output as the tags don’t line up for easy human parsing. As alluded to before, text searching is clunky at best or unreliable.

So, I suggest adding a tags or similar attribute to tests and parameter to the test decorator to supplant the idea of tagging the descriptions. The --search CLI option could remain for text searching the descriptions, but a new --tags (or whatever name is chosen) option could be added. An implementation detail that would need to be ironed out is whether to support both ‘or’ and ‘and’ cases as well as how for multiple tags.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
thebigmunchcommented, Feb 1, 2020

I’m not sure about the comma separated tags via the CLI to represent the conjunction

  • I can picture + being used in tags common enough to want to spare it. And I don’t think it looks as good.
  • / is even more likely to be used than +.
  • & would require shell escaping, which isn’t great. That’s one of the reasons I dislike your initial syntax suggestion.
  • This is actually close to the use of the comma in language, so I don’t think it will be strange for people. Most will understand it quickly from just a bit of help text.

CLI syntax is too simple for an absolutely perfect analogue for this complexity, which isn’t even that complex. So, a bit of stretching is going to be necessary. I’d love to hear others’ thoughts, opinions, or suggestions.

I haven’t really had much need for an exclude, but I can definitely see that being desired. That could easily share the same design as the --tags option with an added condition like:

and not any(
	all(
		tag in test.tags
		for tag in tag_set
	)
	for tag_set in exclude_tags
)
0reactions
darrenburnscommented, Mar 12, 2020

Tagging tests and querying those tags using tag expressions has been released as part of Ward 0.42.0b0, which is now on PyPI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display string as a multiple tag in a single TextView
This is how I separate my string: ArrayList<String> list = Arrays.asList(str.split(","));. now I have separated greeting list, ...
Read more >
How to Use Tags in Microsoft Word - YouTube
This tutorial shows how to use tags in Microsoft Word. Tags can help you improve your file management and file searches through Windows....
Read more >
Tags (Strings) - Phrase
Type a single or multiple tags in the input field at the top of the key list. Click on Add tags. All tags...
Read more >
Use Tags Effectively - Esri
Search using tags. Each item in ArcGIS Online has a title, summary, description, and other information. When you enter a string in Search, ......
Read more >
Template literals (Template strings) - JavaScript | MDN
Tags allow you to parse template literals with a function. The first argument of a tag function contains an array of string values....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found