<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>st-ex</author_name>
  <author_url>https://blog.hatena.ne.jp/st-ex/</author_url>
  <blog_title>STORES Product Blog</blog_title>
  <blog_url>https://product.st.inc/</blog_url>
  <categories>
    <anon>Go</anon>
  </categories>
  <description>はじめに こんにちは、STORESの高田です。 STORES には Go で実装した GraphQL API サーバがあり、そのプロジェクトでは Go のテスト内で E2E テストを行っています。今回はそのテスト方法についてご紹介します。 実装例 今回の E2E テストは CI でも実行したいため、再現性のある安定したテストであることが求められます。 少し工夫する必要がありますが、テスト対象となるサーバのポート確保時に、エニーポートを指定して動的にポートを割り当てることで安定したテストを実現できます。 以下のコードのように、 TestMain 内での net.Listen(&quot;tcp&quot;, &quot;lo…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fproduct.st.inc%2Fentry%2F2024%2F12%2F24%2F160526&quot; title=&quot;Goのテストで GraphQL APIサーバのE2Eテストを書く方法 - STORES Product Blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-12-24 16:05:26</published>
  <title>Goのテストで GraphQL APIサーバのE2Eテストを書く方法</title>
  <type>rich</type>
  <url>https://product.st.inc/entry/2024/12/24/160526</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
