#771: Improve test case coverage for trac-admin command ---------------------------+------------------------ Reporter: rjollos | Owner: nobody Type: defect | Status: new Priority: major | Milestone: Release 9 Component: multiproduct | Version: Resolution: | Keywords: trac-1.0.2 ---------------------------+------------------------
Comment (by olemis): Replying to [ticket:771 rjollos]: > This ticket will explore how we can improve test coverage to avoid defects like those in #756 and #757. > > After tests were added in r1572372, only one failure is seen, with the method that is run on the global environment: `test_product_help_ok`. The tests in `test_product_help_version` and `test_product_help_version_add` should have failed if they were run against a global environment, but don't fail because they are run directly against a product environment. Read below , there's something wrong and code in /trunk is different to what's bee suggested in submitted patches . [...] > > Action items are: > 1. In trac:#11502, test case coverage will be improved in the Trac core. The test methods `test_product_help_version` and `test_product_help_version_add` added in r1572372 will be back-ported. > 1. Refactoring in trac:#11500 needs to be integrated. > 1. Modify test harness so that tests are executed in the global environment. An initial patch is attached: attachment:t771-r1572399.diff. The patch will likely be refined, after trac:#11500 and trac:#11502 are integrated in Bloodhound. Ryan , there's something weird I do not understand . The admin commands have aways been scoped to product context . Parts of your patch are similar to the work I proposed for #757 , see [https://bitbucket.org/olemis/bloodhound- mq/src/t756_admin_failmsg/t757/t757_r1570616_product_help.tests.diff?at=t756_admin_failmsg the original patch] and [attachment:t757_r1570616_product_help.tests.diff:ticket:757 the one submitted for #757] . I do not know why the code in /trunk is different to that . In there I used `self._admin.env_set('', self.global_env)`. Please choose the option you prefer to get it done . I have no objections to follow your approach . I agree with adding `session` as a global admin command . OTOH , notice that , the initial multi-product test case translation was performed before implementing `product admin` . Your suggestion of always invoking admin commands in Trac test upon global environment (by adjusting the proper context under the hood) makes sense to me , though in advance it seems to me that it might be confusing or prone to ambiguity , especially for those commands supported for both product and global envs . Nevertheless the patch also excludes `config` command , which is a completely valid admin command for both . Why ? -- Ticket URL: <https://issues.apache.org/bloodhound/ticket/771#comment:3> Apache Bloodhound <https://issues.apache.org/bloodhound/> The Apache Bloodhound issue tracker