<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="104866" data-post-id="104866">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I have badly misread while I was on the phone. Apologies.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="104866" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/code-coverage-tools-for-elixir/18102/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-104866" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="104866"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="104873" data-post-id="104873">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="axelson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/120/26351_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  axelson
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Scenic Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="Fl4m3Ph03n1x" data-post="9" data-topic="18102">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/fl4m3ph03n1x/48/11709_2.png" class="avatar"> Fl4m3Ph03n1x:</div>
<blockquote>
<blockquote>
<p>It is possible, but not always feasible.</p>
</blockquote>
<p>I would agree with you if only guards weren’t limited. The limitations with guards directly imply that some conditions cannot be converted into the pattern matching formula. For example, <code>Map.key?</code> can’t be used in a guard. if you have</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">if Map.key?(a), do: b, else: c
</code></pre>
<p>Then you are stuck.</p>
</blockquote>
</aside>
<p>I believe what <a class="mention" href="/u/hauleth" rel="nofollow">@hauleth</a> was driving at is that you can restructure that code as</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def handle_has_key(true), do: b
def handle_has_key(false), do: c

def main do
  handle_has_key(Map.key?(a))
end
</code></pre>
<p>i.e. pass the result of the check into the function</p>
<p>Of course, I’m not advocating to write all your code in this manner, just pointing out that it is possible</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="104873" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/code-coverage-tools-for-elixir/18102/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-104873" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="104873"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="127299" data-post-id="127299">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="michalmuskala" data-post="10" data-topic="18102">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/michalmuskala/48/20288_2.png" class="avatar"> michalmuskala:</div>
<blockquote>
<p>An Elixir version that worked on Elixir AST in a similar way wouldn’t be extremely hard to do.</p>
</blockquote>
</aside>
<p>I would be extremely hard to do because of two things:</p>
<ol>
<li>
<p>the very tenuous mapping between Elixir’s AST and the macro-expanded version. This makes it very hard to count which branches we covered, because the branches in the macro-expanded code are not necessarily related to the branches in the original code</p>
</li>
<li>
<p>It’s very hard to get the Elixir AST for a given module. You’d have to use files as compilation units, and not modules.</p>
</li>
</ol>
<p>Maybe it’s not as hard as I think it is, but it’s certainly not very easy. It’s much easir to get access to and manipulate the Erlang abstract format. I mean, I can’t even find a way to expand something inside a <code>defmodule</code> into Elixir AST. That’s probably because <code>defmodule</code> acts more like a function that creates a module and injects it into the running BEAM instance than a macro that is expanded into something more basic.</p>
<p>I guess this probably means there isn’t even a “fully expanded ast” for me to look at. But there must be <em>something</em> that the Elixir compiler feeds into the Erlang compiler, right?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="127299" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/code-coverage-tools-for-elixir/18102/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-127299" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="127299"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="204455" data-post-id="204455">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cblavier" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cblavier/120/29763_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cblavier
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just a brief update, because I needed to get solid code coverage for a decent phoenix app (umbrella app of 5 sub-apps, 17k loc).</p>
<p>On the app side, we’ve been using <a href="https://github.com/parroty/excoveralls" rel="noopener nofollow ugc">excoveralls</a> : it is reliable, can be run in umbrella apps, with partitioned parallel testing and can output in different formats. <img src="https://forum.elixirforum.com/images/emoji/apple/ok_hand.png?v=15" title=":ok_hand:" class="emoji" alt=":ok_hand:" loading="lazy" width="20" height="20"></p>
<p>Then we needed also a good UI to be able to drill down within our application code to know what to test to improve our code coverage. I tested:</p>
<ul>
<li>
<p><a href="https://coveralls.io" rel="noopener nofollow ugc">coveralls.io</a>: the UI is only OK but not really convenient nor pretty. I could not make Github Status checks or comments to work (in order to get instant code coverage feedback when opening a pull request). Integration in the CI was not really convenient as well because we had to disable partitioned testing to run all tests at once and upload a single report.</p>
</li>
<li>
<p><a href="https://codeclimate.com" rel="noopener nofollow ugc">codeclimate.com</a> was disapointing <img src="https://forum.elixirforum.com/images/emoji/apple/frowning_face.png?v=15" title=":frowning_face:" class="emoji" alt=":frowning_face:" loading="lazy" width="20" height="20"> Integration within CI was ok : we had to generate multiple json reports (one per partition) with <code>excoveralls</code> then format them, merge them and upload the whole with <code>cc_test_reporter</code> (binary provided by code_climate). Github feedback is working well, but you can’t really explore your code source tree within codeclimate UI. No go <img src="https://forum.elixirforum.com/images/emoji/apple/no_good_man.png?v=15" title=":no_good_man:" class="emoji" alt=":no_good_man:" loading="lazy" width="20" height="20"></p>
</li>
<li>
<p><a href="https://codecov.io" rel="noopener nofollow ugc">codecov.io</a> is our choice. Integration within the CI is really simple : you can upload multiple report for a single build (one per test partition) and everything will be merged on the serverside. Github feedback is really insightful and the UI gives you the ability to drill down as you want to build your test coverage strategy <img src="https://forum.elixirforum.com/images/emoji/apple/medal_sports.png?v=15" title=":medal_sports:" class="emoji" alt=":medal_sports:" loading="lazy" width="20" height="20"></p>
</li>
</ul>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/1/4/145f57d6afb76dadc9597858893238ad76a36787.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/145f57d6afb76dadc9597858893238ad76a36787" title="CleanShot 2021-02-23 at 11.23.04@2x" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/1/4/145f57d6afb76dadc9597858893238ad76a36787_2_496x600.jpeg" alt="CleanShot 2021-02-23 at 11.23.04@2x" data-base62-sha1="2UdOUjgYYILNxmhKNkhW5IF33Kv" width="496" height="600" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/1/4/145f57d6afb76dadc9597858893238ad76a36787_2_496x600.jpeg, https://forum.elixirforum.com/uploads/default/optimized/3X/1/4/145f57d6afb76dadc9597858893238ad76a36787_2_744x900.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/optimized/3X/1/4/145f57d6afb76dadc9597858893238ad76a36787_2_992x1200.jpeg 2x" data-dominant-color="F3F5F7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">CleanShot 2021-02-23 at 11.23.04@2x</span><span class="informations">1950×2358 217 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p><a href="https://cln.sh/8NaOj8" rel="noopener nofollow ugc">Codecov sunburst GIF here</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="204455" data-batch-url="/posts/batch_likers">
                        11
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/code-coverage-tools-for-elixir/18102/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-204455" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="204455"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="209692" data-post-id="209692">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Fl4m3Ph03n1x" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Fl4m3Ph03n1x/120/11709_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Fl4m3Ph03n1x
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Does <a href="http://codecov.io" rel="noopener nofollow ugc">codecov.io</a> give you a coverage and status badge?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="209692" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/code-coverage-tools-for-elixir/18102/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-209692" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="209692"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="209694" data-post-id="209694">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cblavier" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cblavier/120/29763_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cblavier
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Sure <img src="https://forum.elixirforum.com/images/emoji/apple/+1.png?v=15" title=":+1:" class="emoji" alt=":+1:" loading="lazy" width="20" height="20">  Look at my repo here:</p>
<p><a href="https://github.com/cblavier/phx_component_helpers" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/cblavier/phx_component_helpers</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="209694" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/code-coverage-tools-for-elixir/18102/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-209694" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="209694"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="251745" data-post-id="251745">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cblavier" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cblavier/120/29763_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cblavier
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hey there, I just wrote this article:</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://www.christianblavier.com/boost-your-test-coverage-with-elixir/">
  <header class="source">
      <img src="https://www.christianblavier.com/content/images/size/w256h256/2019/12/CleanShot-2019-12-09-at-18.27.41@2x.png" class="site-icon" alt="" width="256" height="256">

      <a href="https://www.christianblavier.com/boost-your-test-coverage-with-elixir/" target="_blank" rel="noopener nofollow ugc" title="08:53AM - 30 May 2022">Bits of Code - Pieces of Writing – 30 May 22</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:690/459;"><img src="https://www.christianblavier.com/content/images/2022/05/social-1.png" class="thumbnail" alt="" width="690" height="460"></div>

<h3><a href="https://www.christianblavier.com/boost-your-test-coverage-with-elixir/" target="_blank" rel="noopener nofollow ugc">Boost your test coverage with Elixir</a></h3>

  <p>In this article, I will help you build the appropriate tooling to track and measure your test coverage, and hopefully improve it.</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="251745" data-batch-url="/posts/batch_likers">
                        11
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/code-coverage-tools-for-elixir/18102/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-251745" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="251745"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>