<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Rewrite 'pull-os-versions' script in JavaScript and add ability to report os commits with sub-commits."
   href="https://bugs.webkit.org/show_bug.cgi?id=169542#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Rewrite 'pull-os-versions' script in JavaScript and add ability to report os commits with sub-commits."
   href="https://bugs.webkit.org/show_bug.cgi?id=169542">bug 169542</a>
              from <span class="vcard"><a class="email" href="mailto:rniwa&#64;webkit.org" title="Ryosuke Niwa &lt;rniwa&#64;webkit.org&gt;"> <span class="fn">Ryosuke Niwa</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=304241&amp;action=diff" name="attach_304241" title="patch">attachment 304241</a> <a href="attachment.cgi?id=304241&amp;action=edit" title="patch">[details]</a></span>
patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=304241&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=304241&amp;action=review</a>

<span class="quote">&gt; Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js:13
&gt; +class MockLogger {</span >

think we should share the with the other test I had.

<span class="quote">&gt; Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js:29
&gt; +        MockData.resetV3Models();</span >

You don't need this.

<span class="quote">&gt; Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js:52
&gt; +    const sampleSubCommit0 = {</span >

Please call this otherSampleCommit or something instead of suffixing it with a number.

<span class="quote">&gt; Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js:102
&gt; +        it('should calculate the right order for a given valid revision', done =&gt; {
&gt; +            new Promise((resolve, reject) =&gt; {</span >

You don't need to have &quot;done&quot; argument here or wrap the tests in a promise.

<span class="quote">&gt; Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js:114
&gt; +        it('should only return commits whose orders are higher than specified order', (done) =&gt; {</span >

Instead of taking done here.

<span class="quote">&gt; Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js:118
&gt; +            fetchter._availableBuildsFromCommand(&quot;OSX&quot;, [&quot;list&quot;, &quot;build1&quot;], &quot;^\\.*$&quot;, 1604000000).then((results) =&gt; {</span >

Just return this promise.

<span class="quote">&gt; Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js:127
&gt; +            done();</span >

In particular, this test is broken because you're calling done before the promised returned by _availableBuildsFromCommand is resolved.

<span class="quote">&gt; Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js:142
&gt; +                assert.equal(results[0]['repository'], sampleCommit['repository']);
&gt; +                assert.equal(results[0]['revision'], sampleCommit['revision']);</span >

You can also do: assert.deepEqual to compare dictionaries / arrays.

<span class="quote">&gt; Websites/perf.webkit.org/tools/pull-os-versions.js:26
&gt; +    global.AnalysisTask._fetchAllPromise = null;</span >

You don't need any of these.

<span class="quote">&gt; Websites/perf.webkit.org/tools/pull-os-versions.js:46
&gt; +    console.log(`Fetching the manifest...`);
&gt; +
&gt; +    Manifest.fetch().then(function () {</span >

It seems like this whole step is completely unnecessary.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>