TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How best to build a Python-based integration test suite?

2 pointsby josh-wralealmost 10 years ago
I&#x27;m working on a project where I need to do integration testing against a stateless REST API that is written in Java. The API tier itself is stateless, but there are several stateful APIs and databases behind the API in question.<p>The team has an existing test suite of around 20 test cases that consists of Python scripts backed by a sort of QA-Team-produced SDK module for that API. All test cases are at present performed manually.<p>My first assignment is to write a shell script that manually runs all the test cases (Python scripts) and displays friendly results while handling the shuttling of logs around the filesystem (all test cases write to the same log file in .&#x2F;).<p>In the long run, I think Jenkins would be a good way to seat the scripts and their results in a web-enabled dashboard&#x2F;HUD. Also, I wonder if using a Python testing framework would resolve the need to maintain (NIH-style) all the scaffolding. Would mock backends make sense here?<p>I&#x27;m eager to forge, once I gain a better understanding on the systems and existing testing methods, a more automated and efficient QA pipeline. Any tips would be very helpful and much appreciated.<p>Thanks!

1 comment

viraptoralmost 10 years ago
&gt; a shell script that manually runs all the test cases<p>There&#x27;s likely a better and faster way of just doing that in Python. No need to read the list and try to parse it properly in shell.<p>&gt; Jenkins would be a good way to seat the scripts and their results<p>Yes, likely.<p>&gt; if using a Python testing framework would resolve the need to maintain (NIH-style) all the scaffolding<p>Depends what&#x27;s in the scaffolding and what do you log. Unittest framework will help you with test discovery, running and collecting results. It will not make application-specific logs easier. It may actually make it harder if by &quot;log&quot; you mean just printing to stdout&#x2F;err.<p>&gt; Would mock backends make sense here?<p>This doesn&#x27;t really follow from previous text. You&#x27;re either using mocking concept in your tests or not. If they&#x27;re used and implemented locally, there are probably good reasons to move to known mocking modules. If you don&#x27;t use mocking, that&#x27;s a question completely different from the execution framework itself.