<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:39:24 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[GODRIVER-2805] mtest: Add a way to check if all MockResponses have been consumed</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2805</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;Scenario:&lt;/p&gt;

&lt;p&gt;You create a unit test with 5 mock responses, and you want to make sure that each of those responses will be consumed.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;We have collection A and B. We want to asure in unit test, that when there is an insert on collection A, an insert on collection B will be executed. So we need a method NoRemainingMockResponses() which returns true if all mock responses had consumed.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2312587">GODRIVER-2805</key>
            <summary>mtest: Add a way to check if all MockResponses have been consumed</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="5" iconUrl="https://jira.mongodb.org/images/icons/priorities/trivial.svg">Trivial - P5</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13203">Gone away</resolution>
                                        <assignee username="qingyang.hu@mongodb.com">Qingyang Hu</assignee>
                                    <reporter username="stavtsob@gmail.com">Stavros Tsompanidis</reporter>
                        <labels>
                    </labels>
                <created>Wed, 12 Apr 2023 12:22:50 +0000</created>
                <updated>Fri, 27 Oct 2023 20:01:09 +0000</updated>
                            <resolved>Thu, 6 Jul 2023 12:00:50 +0000</resolved>
                                                                    <component>Testing</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5546911" author="dbeng-pm-bot" created="Thu, 6 Jul 2023 12:00:53 +0000"  >&lt;p&gt;There hasn&apos;t been any recent activity on this ticket, so we&apos;re resolving it. Thanks for reaching out! Please feel free to reopen this ticket if you&apos;re still experiencing the issue, and add a comment if you&apos;re able to provide more information.&lt;/p&gt;</comment>
                            <comment id="5530666" author="dbeng-pm-bot" created="Wed, 28 Jun 2023 13:10:46 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=stavtsob%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;stavtsob@gmail.com&quot;&gt;stavtsob@gmail.com&lt;/a&gt;! &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2805&quot; title=&quot;mtest: Add a way to check if all MockResponses have been consumed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2805&quot;&gt;&lt;del&gt;GODRIVER-2805&lt;/del&gt;&lt;/a&gt; is awaiting your response. &lt;/p&gt;

&lt;p&gt;If this is still an issue for you, please open Jira to review the latest status and provide your feedback. Thanks!&lt;/p&gt;</comment>
                            <comment id="5513972" author="JIRAUSER1268281" created="Tue, 20 Jun 2023 22:03:48 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=stavtsob%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;stavtsob@gmail.com&quot;&gt;stavtsob@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;We appreciate you bringing this issue to our attention. However, we suggest Go driver users not to use the &lt;tt&gt;mtest&lt;/tt&gt; package in their projects. The &lt;tt&gt;mtest&lt;/tt&gt; package mainly focuses on internal testing. Thus, it is subject to change. Instead, we plan to move &lt;tt&gt;mtest&lt;/tt&gt; into an &lt;tt&gt;internal&lt;/tt&gt; directory in &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2724&quot; title=&quot;Move internal-only packages to &amp;quot;internal/&amp;quot; directories&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2724&quot;&gt;&lt;del&gt;GODRIVER-2724&lt;/del&gt;&lt;/a&gt; for Go driver 2.0 to avoid confusion and misuse.&lt;/p&gt;

&lt;p&gt;We apologize for the inconvenience. Please feel free to leave a comment if you have more concerns.&lt;/p&gt;</comment>
                            <comment id="5355044" author="JIRAUSER1273461" created="Tue, 18 Apr 2023 10:19:31 +0000"  >&lt;p&gt;I also wrote the code for this feature:&lt;/p&gt;

&lt;p&gt;File: mongo/integration/mtest/mongotest.go&lt;/p&gt;


&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;func (t *T) RemainingMockResponses() &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&#160; &#160; &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; len(t.mockDeployment.conn.responses)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="5355041" author="JIRAUSER1273461" created="Tue, 18 Apr 2023 10:17:18 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=esha.bhargava%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;esha.bhargava@mongodb.com&quot;&gt;esha.bhargava@mongodb.com&lt;/a&gt; Example: We are testing a method which is updating the document of collection A. Also while updating the object A, we want to create a document in a different collection B, if some conditions are met. The creation of the document in collection B must not throw an error in case of failure.&lt;br/&gt;
So while we are writing the test for this method, we mock the responses for the collection A, and we make the conditions for the creation of the document for B to be met. But because the block that creates this document (B) does not throw an error in case of failure, how do we know that the code went into the if statement? Only if we knew that the we have mocked the insert response to the collection B and it has been consumed.&lt;/p&gt;</comment>
                            <comment id="5353774" author="esha.bhargava" created="Mon, 17 Apr 2023 19:57:15 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=stavtsob%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;stavtsob@gmail.com&quot;&gt;stavtsob@gmail.com&lt;/a&gt;&#160; Thank you for reporting this issue. Can you elaborate on what kind of interactions with the database are you trying to mock? Can you provide an example test case where you use mock responses?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1mobc:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>