{"action":"created","issue":{"url":"https://api.github.com/repos/ARMmbed/greentea/issues/129","repository_url":"https://api.github.com/repos/ARMmbed/greentea","labels_url":"https://api.github.com/repos/ARMmbed/greentea/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/ARMmbed/greentea/issues/129/comments","events_url":"https://api.github.com/repos/ARMmbed/greentea/issues/129/events","html_url":"https://github.com/ARMmbed/greentea/pull/129","id":156377466,"number":129,"title":"Fixing stack trace when a bad test name is specified.","user":{"login":"bridadan","id":3123977,"avatar_url":"https://avatars.githubusercontent.com/u/3123977?v=3","gravatar_id":"","url":"https://api.github.com/users/bridadan","html_url":"https://github.com/bridadan","followers_url":"https://api.github.com/users/bridadan/followers","following_url":"https://api.github.com/users/bridadan/following{/other_user}","gists_url":"https://api.github.com/users/bridadan/gists{/gist_id}","starred_url":"https://api.github.com/users/bridadan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bridadan/subscriptions","organizations_url":"https://api.github.com/users/bridadan/orgs","repos_url":"https://api.github.com/users/bridadan/repos","events_url":"https://api.github.com/users/bridadan/events{/privacy}","received_events_url":"https://api.github.com/users/bridadan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bridadan","id":3123977,"avatar_url":"https://avatars.githubusercontent.com/u/3123977?v=3","gravatar_id":"","url":"https://api.github.com/users/bridadan","html_url":"https://github.com/bridadan","followers_url":"https://api.github.com/users/bridadan/followers","following_url":"https://api.github.com/users/bridadan/following{/other_user}","gists_url":"https://api.github.com/users/bridadan/gists{/gist_id}","starred_url":"https://api.github.com/users/bridadan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bridadan/subscriptions","organizations_url":"https://api.github.com/users/bridadan/orgs","repos_url":"https://api.github.com/users/bridadan/repos","events_url":"https://api.github.com/users/bridadan/events{/privacy}","received_events_url":"https://api.github.com/users/bridadan/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-05-23T22:06:13Z","updated_at":"2016-05-25T09:58:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ARMmbed/greentea/pulls/129","html_url":"https://github.com/ARMmbed/greentea/pull/129","diff_url":"https://github.com/ARMmbed/greentea/pull/129.diff","patch_url":"https://github.com/ARMmbed/greentea/pull/129.patch"},"body":"If you specify an incorrect test name with the `-n` when using a test spec file, you get and `AttributeError` stack trace:\r\n\r\n```\r\nC:\\m\\proj>mbedgt -V --test-spec=test_spec.json -n bad-test-name\r\nmbedgt: detecting connected mbed-enabled devices...\r\nmbedgt: detected 1 device\r\n        detected 'K64F' -> 'K64F[0]', console at 'COM238', mounted at 'D:', target id '0240000033514e450014500585d4004be981000097969900'\r\nmbedgt: processing target 'K64F' toolchain 'GCC_ARM' compatible platforms...\r\nmbedgt: using platform 'K64F' for test:\r\n        target_id_mbed_htm = '0240000033514e450014500585d4004be981000097969900'\r\n        daplink_hic_id = '97969900'\r\n        mount_point = 'D:'\r\n        daplink_automation_allowed = '0'\r\n        daplink_daplink_mode = 'Interface'\r\n        daplink_local_mods = '0'\r\n        daplink_unique_id = '0240000033514e450014500585d4004be981000097969900'\r\n        daplink_interface_crc = '0x33e2dd18'\r\n        target_id = '0240000033514e450014500585d4004be981000097969900'\r\n        serial_port = 'COM238:9600'\r\n        target_id_usb_id = '0240000033514e450014500585d4004be981000097969900'\r\n        platform_name = 'K64F'\r\n        platform_name_unique = 'K64F[0]'\r\n        daplink_git_sha = '34182e2cce4ca99073443ef29fbcfaab9e18caec'\r\n        daplink_interface_version = '0241'\r\n        daplink_auto_reset = '0'\r\n        daplink_usb_interfaces = 'MSD, CDC, HID'\r\n        daplink_version = '0241'\r\nmbedgt: test case filter (specified with -n option)\r\nmbedgt: invalid test case names (specified with '-n' option)\r\nmbedgt: test name 'bad-test-name' not found in 'test_spec.json' (specified with --test-spec option)\r\n        note: test case names are case sensitive\r\n        note: see list of available test cases below\r\nmbedgt: unexpected error:\r\n        'str' object has no attribute 'get_test_builds'\r\nTraceback (most recent call last):\r\n  File \"C:\\Python27\\Scripts\\mbedgt-script.py\", line 9, in <module>\r\n    load_entry_point('mbed-greentea', 'console_scripts', 'mbedgt')()\r\n  File \"c:\\users\\bridan01\\documents\\dev\\greentea\\mbed_greentea\\mbed_greentea_cli.py\", line 345, in main\r\n    cli_ret = main_cli(opts, args)\r\n  File \"c:\\users\\bridan01\\documents\\dev\\greentea\\mbed_greentea\\mbed_greentea_cli.py\", line 734, in main_cli\r\n    filtered_ctest_test_list = create_filtered_test_list(test_list, opts.test_by_names, opts.skip_test, test_spec=opts.test_spec)\r\n  File \"c:\\users\\bridan01\\documents\\dev\\greentea\\mbed_greentea\\mbed_greentea_cli.py\", line 144, in create_filtered_test_list\r\n    list_binaries_for_builds(test_spec)\r\n  File \"c:\\users\\bridan01\\documents\\dev\\greentea\\mbed_greentea\\cmake_handlers.py\", line 112, in list_binaries_for_builds\r\n    test_builds = test_spec.get_test_builds()\r\nAttributeError: 'str' object has no attribute 'get_test_builds'\r\n```\r\n\r\nThe issue was the passed test spec filename in the `create_filtered_test_list` function was not being parsed before being passed to the `list_binaries_for_builds` function. I fixed this by parsing it first."},"comment":{"url":"https://api.github.com/repos/ARMmbed/greentea/issues/comments/221527855","html_url":"https://github.com/ARMmbed/greentea/pull/129#issuecomment-221527855","issue_url":"https://api.github.com/repos/ARMmbed/greentea/issues/129","id":221527855,"user":{"login":"PrzemekWirkus","id":6360720,"avatar_url":"https://avatars.githubusercontent.com/u/6360720?v=3","gravatar_id":"","url":"https://api.github.com/users/PrzemekWirkus","html_url":"https://github.com/PrzemekWirkus","followers_url":"https://api.github.com/users/PrzemekWirkus/followers","following_url":"https://api.github.com/users/PrzemekWirkus/following{/other_user}","gists_url":"https://api.github.com/users/PrzemekWirkus/gists{/gist_id}","starred_url":"https://api.github.com/users/PrzemekWirkus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrzemekWirkus/subscriptions","organizations_url":"https://api.github.com/users/PrzemekWirkus/orgs","repos_url":"https://api.github.com/users/PrzemekWirkus/repos","events_url":"https://api.github.com/users/PrzemekWirkus/events{/privacy}","received_events_url":"https://api.github.com/users/PrzemekWirkus/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T09:58:26Z","updated_at":"2016-05-25T09:58:26Z","body":"I will align with file_name in this case."}}
{"actor":{"display_login":"PrzemekWirkus"}}