Postman native git - pre-request scripts going through twice with datafile on local branch

We are currently testing the native git conversion of our postman collection.
* Collection was imported using json export of the original collection

We are seeing some unexpected behaviour when running tests with a datafile on local branch where the pre-request script is running twice.

Below is a screenshot of the console where the same collection is ran twice (our pre-request scripts have the shown console logs)

  1. Blue (cloud)
  2. Red (local git branch)

Steps to reproduce:

  • Postman desktop app (v12.4.3), Windows 11 Business
  • on a Postman collection converted to use native git, run a test that uses a datafile on Postman cloud for comparison
  • create and checkout a branch in the associated git repo, and switch to that branch locally on the Postman desktop app
  • run the same tests and use same datafile

Observe that the pre-request script appears to go through twice. On other test runs, this has caused failures in other tests which rely more heavily on the pre-request script to set up our test scenario.

We have pre-request scripts at the folder and collection level as well that hold shared functions and constants. We did update the tests to not call anything in those pre-request scripts to see if there was any change in behaviour, but the issue still persists.

Wondering if anyone else is experiencing this or maybe help looking at possible causes.

1 Like

Hey @alison :waving_hand:

Welcome back to the Postman Community! :postman:

We have released a fix for this in the latest version, are you able to give this another go and let up know please?

Hi,

Thank you for your follow up. It is working now with the example above. I did run latest against a more complex data driven collection and noticed some minor discrepancies in behaviour.

(So with the example I used above it was working.)

Example below does make use of functions in the pre-request script, I previously mentioned.

Postman v12.5.4

Postman Cloud:

  • highlighted is the output we would normally see in our execution
  • we did notice that only console.log outputs not being displayed are created from our shared functions located in the pre-request script at the collection level

Fresh local git branch:

  • output is missing output console logs from shared functions in collection level pre-request script
  • the api requests are “grey”

However, I’m not too fussed about whether or not we can display console output from the pre-request scripts, especially it is working functionally and the changes will eventually make it to Postman Cloud (an entirely different issue we’re encountering). I did think we should highlight that there are still some discrepancies being observed in case it is indicative of anything else.