{"action":"created","issue":{"url":"https://api.github.com/repos/eth-cscs/reframe/issues/138","repository_url":"https://api.github.com/repos/eth-cscs/reframe","labels_url":"https://api.github.com/repos/eth-cscs/reframe/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/eth-cscs/reframe/issues/138/comments","events_url":"https://api.github.com/repos/eth-cscs/reframe/issues/138/events","html_url":"https://github.com/eth-cscs/reframe/issues/138","id":299788068,"number":138,"title":"2.10 public release introduces \"KeyError: 'testcase_name'\" warnings","user":{"login":"bcfriesen","id":979133,"avatar_url":"https://avatars1.githubusercontent.com/u/979133?v=4","gravatar_id":"","url":"https://api.github.com/users/bcfriesen","html_url":"https://github.com/bcfriesen","followers_url":"https://api.github.com/users/bcfriesen/followers","following_url":"https://api.github.com/users/bcfriesen/following{/other_user}","gists_url":"https://api.github.com/users/bcfriesen/gists{/gist_id}","starred_url":"https://api.github.com/users/bcfriesen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcfriesen/subscriptions","organizations_url":"https://api.github.com/users/bcfriesen/orgs","repos_url":"https://api.github.com/users/bcfriesen/repos","events_url":"https://api.github.com/users/bcfriesen/events{/privacy}","received_events_url":"https://api.github.com/users/bcfriesen/received_events","type":"User","site_admin":false},"labels":[{"id":591715742,"url":"https://api.github.com/repos/eth-cscs/reframe/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"open","locked":false,"assignee":{"login":"vkarak","id":611019,"avatar_url":"https://avatars1.githubusercontent.com/u/611019?v=4","gravatar_id":"","url":"https://api.github.com/users/vkarak","html_url":"https://github.com/vkarak","followers_url":"https://api.github.com/users/vkarak/followers","following_url":"https://api.github.com/users/vkarak/following{/other_user}","gists_url":"https://api.github.com/users/vkarak/gists{/gist_id}","starred_url":"https://api.github.com/users/vkarak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkarak/subscriptions","organizations_url":"https://api.github.com/users/vkarak/orgs","repos_url":"https://api.github.com/users/vkarak/repos","events_url":"https://api.github.com/users/vkarak/events{/privacy}","received_events_url":"https://api.github.com/users/vkarak/received_events","type":"User","site_admin":false},"assignees":[{"login":"vkarak","id":611019,"avatar_url":"https://avatars1.githubusercontent.com/u/611019?v=4","gravatar_id":"","url":"https://api.github.com/users/vkarak","html_url":"https://github.com/vkarak","followers_url":"https://api.github.com/users/vkarak/followers","following_url":"https://api.github.com/users/vkarak/following{/other_user}","gists_url":"https://api.github.com/users/vkarak/gists{/gist_id}","starred_url":"https://api.github.com/users/vkarak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkarak/subscriptions","organizations_url":"https://api.github.com/users/vkarak/orgs","repos_url":"https://api.github.com/users/vkarak/repos","events_url":"https://api.github.com/users/vkarak/events{/privacy}","received_events_url":"https://api.github.com/users/vkarak/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-02-23T17:23:58Z","updated_at":"2018-02-23T18:55:07Z","closed_at":null,"author_association":"NONE","body":"Starting with commit 24b605e (\"Reframe 2.10 public release\"), my tests now generate huge amounts of warning messages like the following:\r\n```\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/usr/common/software/python/3.6-anaconda-4.4/lib/python3.6/logging/__init__.py\", line 992, in emit\r\n    msg = self.format(record)\r\n  File \"/usr/common/software/python/3.6-anaconda-4.4/lib/python3.6/logging/__init__.py\", line 838, in format\r\n    return fmt.format(record)\r\n  File \"/usr/common/software/python/3.6-anaconda-4.4/lib/python3.6/logging/__init__.py\", line 578, in format\r\n    s = self.formatMessage(record)\r\n  File \"/usr/common/software/python/3.6-anaconda-4.4/lib/python3.6/logging/__init__.py\", line 547, in formatMessage\r\n    return self._style.format(record)\r\n  File \"/usr/common/software/python/3.6-anaconda-4.4/lib/python3.6/logging/__init__.py\", line 391, in format\r\n    return self._fmt % record.__dict__\r\nKeyError: 'testcase_name'\r\nCall stack:\r\n  File \"/global/homes/f/friesen/reframe/bin/reframe\", line 6, in <module>\r\n    cli.main()\r\n  File \"/global/u2/f/friesen/reframe/reframe/frontend/cli.py\", line 417, in main\r\n    printer.info(runner.stats.failure_report())\r\n  File \"/global/u2/f/friesen/reframe/reframe/frontend/printer.py\", line 113, in info\r\n    self._logger.info(msg)\r\n  File \"/usr/common/software/python/3.6-anaconda-4.4/lib/python3.6/logging/__init__.py\", line 1634, in info\r\n    self.log(INFO, msg, *args, **kwargs)\r\n  File \"/global/u2/f/friesen/reframe/reframe/core/logging.py\", line 225, in log\r\n    super().log(level, msg, *args, **kwargs)\r\n```\r\nIn commits prior to this one, these warnings did not occur. Note that the functionality appears to be unchanged and the tests run as normal.\r\n\r\nLooking through the changes in this commit, it seems there are several places where `testcase_name` was either removed altogether, or replaced with `check_info`. These include:\r\n\r\n```\r\n@@ -152,20 +152,6 @@ class Logger(logging.Logger):\r\n\r\n     def makeRecord(self, name, level, fn, lno, msg, args, exc_info,\r\n                    func=None, extra=None, sinfo=None):\r\n-        # Setup dynamic fields of the check\r\n-        if self.check:\r\n-            testcase_name = self.check.name\r\n-            if self.check.job:\r\n-                extra['check_jobid'] = self.check.job.jobid\r\n-\r\n-            if self.check.current_partition:\r\n-                testcase_name += '@%s' % self.check.current_partition.fullname\r\n-\r\n-            if self.check.current_environ:\r\n-                testcase_name += ' using %s' % self.check.current_environ.name\r\n-\r\n-            extra['testcase_name'] = testcase_name\r\n-\r\n```\r\nas well as here:\r\n```\r\n@@ -206,12 +192,11 @@ class LoggerAdapter(logging.LoggerAdapter):\r\n             {\r\n                 'check_name': check.name if check else 'reframe',\r\n                 'check_jobid': '-1',\r\n-                'testcase_name': check.name if check else 'reframe',\r\n+                'check_info': check.info() if check else 'reframe',\r\n                 'version': reframe.VERSION,\r\n```\r\nand here:\r\n```\r\n@@ -752,7 +814,7 @@ class RegressionTest:\r\n                 self._perf_logfile: {\r\n                     'level': 'DEBUG',\r\n                     'format': '[%(asctime)s] reframe %(version)s: '\r\n-                              '%(testcase_name)s '\r\n+                              '%(check_info)s '\r\n```"},"comment":{"url":"https://api.github.com/repos/eth-cscs/reframe/issues/comments/368104845","html_url":"https://github.com/eth-cscs/reframe/issues/138#issuecomment-368104845","issue_url":"https://api.github.com/repos/eth-cscs/reframe/issues/138","id":368104845,"user":{"login":"vkarak","id":611019,"avatar_url":"https://avatars1.githubusercontent.com/u/611019?v=4","gravatar_id":"","url":"https://api.github.com/users/vkarak","html_url":"https://github.com/vkarak","followers_url":"https://api.github.com/users/vkarak/followers","following_url":"https://api.github.com/users/vkarak/following{/other_user}","gists_url":"https://api.github.com/users/vkarak/gists{/gist_id}","starred_url":"https://api.github.com/users/vkarak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkarak/subscriptions","organizations_url":"https://api.github.com/users/vkarak/orgs","repos_url":"https://api.github.com/users/vkarak/repos","events_url":"https://api.github.com/users/vkarak/events{/privacy}","received_events_url":"https://api.github.com/users/vkarak/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T18:55:07Z","updated_at":"2018-02-23T18:55:07Z","author_association":"COLLABORATOR","body":"Thanks @bcfriesen for reporting this. In 2.10, the `testcase_name` has changed to `check_info`, but unfortunately it has gone out undocumented... The solution is to simply rename `testcase_name` to `check_info` in your configuration file (logging configuration, specifically). Apologies for the inconvenience."}}
{"actor":{"display_login":"vkarak"}}