blob: 0258e3c57c9120634375f7b00aaaac0800ed53a8 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Testing PySpark &#8212; PySpark 3.3.3 documentation</title>
<link rel="stylesheet" href="../_static/css/index.73d71520a4ca3b99cfee5594769eaaae.css">
<link rel="stylesheet"
href="../_static/vendor/fontawesome/5.13.0/css/all.min.css">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="../_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
<link rel="stylesheet"
href="../_static/vendor/open-sans_all/1.44.1/index.css">
<link rel="stylesheet"
href="../_static/vendor/lato_latin-ext/1.44.1/index.css">
<link rel="stylesheet" href="../_static/basic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/css/pyspark.css" />
<link rel="preload" as="script" href="../_static/js/index.3da636dd464baa7582d2.js">
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script src="../_static/copybutton.js"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script>
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Debugging PySpark" href="debugging.html" />
<link rel="prev" title="Contributing to PySpark" href="contributing.html" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="docsearch:language" content="en" />
</head>
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
<nav class="navbar navbar-light navbar-expand-lg bg-light fixed-top bd-navbar" id="navbar-main">
<div class="container-xl">
<a class="navbar-brand" href="../index.html">
<img src="../_static/spark-logo-reverse.png" class="logo" alt="logo" />
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-menu" aria-controls="navbar-menu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar-menu" class="col-lg-9 collapse navbar-collapse">
<ul id="navbar-main-elements" class="navbar-nav mr-auto">
<li class="nav-item ">
<a class="nav-link" href="../getting_started/index.html">Getting Started</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="../user_guide/index.html">User Guide</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="../reference/index.html">API Reference</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="index.html">Development</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="../migration_guide/index.html">Migration Guide</a>
</li>
</ul>
<ul class="navbar-nav">
</ul>
</div>
</div>
</nav>
<div class="container-xl">
<div class="row">
<div class="col-12 col-md-3 bd-sidebar"><form class="bd-search d-flex align-items-center" action="../search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form>
<nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav">
<li class="">
<a href="contributing.html">Contributing to PySpark</a>
</li>
<li class="active">
<a href="">Testing PySpark</a>
</li>
<li class="">
<a href="debugging.html">Debugging PySpark</a>
</li>
<li class="">
<a href="setting_ide.html">Setting up IDEs</a>
</li>
</ul>
</nav>
</div>
<div class="d-none d-xl-block col-xl-2 bd-toc">
<div class="tocsection onthispage pt-5 pb-3">
<i class="fas fa-list"></i> On this page
</div>
<nav id="bd-toc-nav">
<ul class="nav section-nav flex-column">
<li class="nav-item toc-entry toc-h2">
<a href="#running-individual-pyspark-tests" class="nav-link">Running Individual PySpark Tests</a>
</li>
<li class="nav-item toc-entry toc-h2">
<a href="#running-tests-using-github-actions" class="nav-link">Running tests using GitHub Actions</a>
</li>
</ul>
</nav>
</div>
<main class="col-12 col-md-9 col-xl-7 py-md-5 pl-md-5 pr-md-4 bd-content" role="main">
<div>
<div class="section" id="testing-pyspark">
<h1>Testing PySpark<a class="headerlink" href="#testing-pyspark" title="Permalink to this headline"></a></h1>
<p>In order to run PySpark tests, you should build Spark itself first via Maven or SBT. For example,</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>build/mvn<span class="w"> </span>-DskipTests<span class="w"> </span>clean<span class="w"> </span>package
</pre></div>
</div>
<p>After that, the PySpark test cases can be run via using <code class="docutils literal notranslate"><span class="pre">python/run-tests</span></code>. For example,</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python/run-tests<span class="w"> </span>--python-executable<span class="o">=</span>python3
</pre></div>
</div>
<p>Note that you may set <code class="docutils literal notranslate"><span class="pre">OBJC_DISABLE_INITIALIZE_FORK_SAFETY</span></code> environment variable to <code class="docutils literal notranslate"><span class="pre">YES</span></code> if you are running tests on Mac OS.</p>
<p>Please see the guidance on how to <a class="reference external" href="https://github.com/apache/spark#building-spark">build Spark</a>,
<a class="reference external" href="https://spark.apache.org/developer-tools.html">run tests for a module, or individual tests</a>.</p>
<div class="section" id="running-individual-pyspark-tests">
<h2>Running Individual PySpark Tests<a class="headerlink" href="#running-individual-pyspark-tests" title="Permalink to this headline"></a></h2>
<p>You can run a specific test via using <code class="docutils literal notranslate"><span class="pre">python/run-tests</span></code>, for example, as below:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python/run-tests<span class="w"> </span>--testnames<span class="w"> </span>pyspark.sql.tests.test_arrow
</pre></div>
</div>
<p>Please refer to <a class="reference external" href="https://spark.apache.org/developer-tools.html">Testing PySpark</a> for more details.</p>
</div>
<div class="section" id="running-tests-using-github-actions">
<h2>Running tests using GitHub Actions<a class="headerlink" href="#running-tests-using-github-actions" title="Permalink to this headline"></a></h2>
<p>You can run the full PySpark tests by using GitHub Actions in your own forked GitHub
repository with a few clicks. Please refer to
<a class="reference external" href="https://spark.apache.org/developer-tools.html">Running tests in your forked repository using GitHub Actions</a> for more details.</p>
</div>
</div>
</div>
<div class='prev-next-bottom'>
<a class='left-prev' id="prev-link" href="contributing.html" title="previous page">Contributing to PySpark</a>
<a class='right-next' id="next-link" href="debugging.html" title="next page">Debugging PySpark</a>
</div>
</main>
</div>
</div>
<script src="../_static/js/index.3da636dd464baa7582d2.js"></script>
<footer class="footer mt-5 mt-md-0">
<div class="container">
<p>
&copy; Copyright .<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 3.0.4.<br/>
</p>
</div>
</footer>
</body>
</html>