Title: App Engine testrunner should exit with a non-zero exit code when tests fail · Issue #503 · GoogleCloudPlatform/python-docs-samples · GitHub
Open Graph Title: App Engine testrunner should exit with a non-zero exit code when tests fail · Issue #503 · GoogleCloudPlatform/python-docs-samples
X Title: App Engine testrunner should exit with a non-zero exit code when tests fail · Issue #503 · GoogleCloudPlatform/python-docs-samples
Description: This doesn't seem significant enough for me to want to fill out a CLA... / please add this. I'm trying out Bitbucket Pipelines and noticed that my builds were passing even though tests were failing. This is due to the fact that the testr...
Open Graph Description: This doesn't seem significant enough for me to want to fill out a CLA... / please add this. I'm trying out Bitbucket Pipelines and noticed that my builds were passing even though tests were failing...
X Description: This doesn't seem significant enough for me to want to fill out a CLA... / please add this. I'm trying out Bitbucket Pipelines and noticed that my builds were passing even though tests were...
Opengraph URL: https://github.com/GoogleCloudPlatform/python-docs-samples/issues/503
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"App Engine testrunner should exit with a non-zero exit code when tests fail","articleBody":"This doesn't seem significant enough for me to want to fill out a CLA... / please add this.\n\nI'm trying out [Bitbucket Pipelines](https://confluence.atlassian.com/bitbucket/bitbucket-pipelines-beta-792496469.html) and noticed that my builds were passing even though tests were failing. This is due to the fact that the testrunner always exits with code 0 ([someone else had a similar problem with PHP tests](https://bitbucket.org/site/master/issues/12810/pipeline-was-marked-as-passed-even-though)).\n\nI suspect the same is true for other build agents. The following patch takes care of it:\n\n```\n--- a/runner.py Tue Sep 06 17:49:32 2016 +0200\n+++ b/runner.py Wed Sep 07 10:56:25 2016 +0200\n@@ -76,7 +76,7 @@\n\n # Discover and run tests.\n suite = unittest.loader.TestLoader().discover(test_path, \"*_test.py\")\n- unittest.TextTestRunner(verbosity=2).run(suite)\n+ return unittest.TextTestRunner(verbosity=2).run(suite)\n\n\n if __name__ == '__main__':\n@@ -88,6 +88,8 @@\n sys.exit(1)\n SDK_PATH = args[0]\n TEST_PATH = args[1]\n- main(SDK_PATH, TEST_PATH)\n+ result = main(SDK_PATH, TEST_PATH)\n+ if not result.wasSuccessful():\n+ sys.exit(1)\n\n # [END runner]\n```\n","author":{"url":"https://github.com/maltem-za","@type":"Person","name":"maltem-za"},"datePublished":"2016-09-07T14:30:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/503/python-docs-samples/issues/503"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:14ebc73c-7836-fbe8-3b53-7c606196ede8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D2C4:37B798:65EF17:956C01:6A4E1186 |
| html-safe-nonce | f5140555ead757a5cf90df478ed7e63911fc0cbd86d60192bce5d21f4dea0b77 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkM0OjM3Qjc5ODo2NUVGMTc6OTU2QzAxOjZBNEUxMTg2IiwidmlzaXRvcl9pZCI6IjYyMTk3NDA3MTIzNDQwOTcxNTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1555eb904270ec3dccb6f4105489994d74c952bada1ec76476728706fd2b8f24 |
| hovercard-subject-tag | issue:175517762 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/GoogleCloudPlatform/python-docs-samples/503/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a0181d303fa2b107099f9a729dddb90f9b47708f24cd66c34fed5b49dc236280/GoogleCloudPlatform/python-docs-samples/issues/503 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a0181d303fa2b107099f9a729dddb90f9b47708f24cd66c34fed5b49dc236280/GoogleCloudPlatform/python-docs-samples/issues/503 |
| og:image:alt | This doesn't seem significant enough for me to want to fill out a CLA... / please add this. I'm trying out Bitbucket Pipelines and noticed that my builds were passing even though tests were failing... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | maltem-za |
| hostname | github.com |
| expected-hostname | github.com |
| None | df0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6 |
| turbo-cache-control | no-preview |
| go-import | github.com/GoogleCloudPlatform/python-docs-samples git https://github.com/GoogleCloudPlatform/python-docs-samples.git |
| octolytics-dimension-user_id | 2810941 |
| octolytics-dimension-user_login | GoogleCloudPlatform |
| octolytics-dimension-repository_id | 35065876 |
| octolytics-dimension-repository_nwo | GoogleCloudPlatform/python-docs-samples |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 35065876 |
| octolytics-dimension-repository_network_root_nwo | GoogleCloudPlatform/python-docs-samples |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 51470c353b8a1f52a88d3e3cc2014b17ab8cc1ce |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width