BackstopJS icon indicating copy to clipboard operation
BackstopJS copied to clipboard

JSON files being written to app directory after running reference

Open james-tannwestlake opened this issue 9 years ago • 3 comments

Hi there,

I'm using backstop in a js file rather than through the CLI and I get random json files being added after the reference is run. This is using chrome as the engine. Example of the json file below

{
  "compareConfig": {
    "testPairs": []
  }
}

I tracked down the source of this file to the function writeCompareConfigFile in the file core/util/createBitmaps.js So I'm wondering what this is used for? I can get a docker example setup if needed, so you can reproduce this

james-tannwestlake avatar Aug 25 '17 12:08 james-tannwestlake

Sorry, I don't remember why it was necessary to generate this file. This is likely old code which can be removed.

garris avatar Aug 31 '17 14:08 garris

Edit: james-tannwestlake is my work github account by the way

Further update on this. I believe the test command requires the temp file with the code at the bottom of the file core/util/compare/index.js

module.exports = function (config) {
  var compareConfig = require(config.tempCompareConfigFileName).compareConfig;
  var report = new Reporter(config.ciReport.testSuiteName);
  var asyncCompareLimit = config.asyncCompareLimit || ASYNC_COMPARE_LIMIT;

  return map(compareConfig.testPairs, pair => comparePair(pair, report, config), {concurrency: asyncCompareLimit})
    .then(
      () => report,
      e => logger.error('The comparison failed with error: ' + e)
    );
};

jimmaaay avatar Sep 05 '17 20:09 jimmaaay

@garris I ran into this too - at the least, can we make the location configurable (or is it?)? Or clean them up after they're no longer needed? Right now, it's polluting a directory that is in git leading to the possibility of someone inadvertently adding these temp files to our repo.

seanr avatar May 07 '18 18:05 seanr