revise language tag handling to be easier to use (T617)
ClosedPublic

Authored by adamwill on Sep 16 2015, 12:55 AM.

Details

Summary

T617 makes some good points about the language tags; this is my
suggestion for an improvement. It requires a bit of cleverness
in unregister_prefix_tags(), but the upshot is that you don't
need to know to set any special tags when creating needles, a
needle with no language-related tags will be considered as valid
for all languages. You have to explicitly add LANGUAGE- tag(s)
to a needle for the language filtering to 'kick in' in any way.
If a needle has at least one LANGUAGE- tag, it will be filtered
unless it has the appropriate tag for the job's specified
language (default is still 'english').

With this approach, only needles which we specifically want to
*only* match their tagged language(s) need the tags, so we can
drop all those -ALL tags.

We're using LANGUAGE- instead of ENV-LANGUAGE- now because the
ENV- tag names denote tags that are treated slightly specially
by openQA, and this is not one. We cannot cleanly use
ENV-INSTLANG because openQA has a hardwired default of 'en_US'
for that.

Test Plan

Check both English and French tests still work as
intended.

Diff Detail

Repository
rOPENQATESTS os-autoinst-distri-fedora
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
adamwill retitled this revision from to revise language tag handling to be easier to use (T617).Sep 16 2015, 12:55 AM
adamwill updated this object.
adamwill edited the test plan for this revision. (Show Details)
adamwill added reviewers: jskladan, garretraziel.
adamwill updated this revision to Diff 1524.Sep 16 2015, 1:05 AM

We really don't need to upper-case the language in the tag name.

adamwill updated this revision to Diff 1556.Sep 24 2015, 2:19 AM

Add a username check as discussed in T617.

garretraziel accepted this revision.Sep 29 2015, 11:53 AM

I've tested it and it works. And since it isn't problem with this diff to have no "LANGUAGE" tag, I am OK with merging this. We could use this as it is for a while and then rethink if we had any problems with it.

This revision is now accepted and ready to land.Sep 29 2015, 11:53 AM
This revision was automatically updated to reflect the committed changes.