vendredi 30 octobre 2015

GoldenFiles testing and TFS server workspaces

Our product (C++ windows application, Google Test as testing framework, VS2015 as IDE) has a number of file-based interfaces to external products, i.e., we generate a file which is then imported into an external product. For testing these interfaces, we have chosen a golden file approach:

  1. Invoke the code that produces an interface file, save the resulting file for later reference (this is our golden file - we here assume that the current state of interface code is correct).
  2. Commit the golden file to the TFS repository.
  3. Make changes to the interface code.
  4. Invoke the code, compare the resulting file with the according golden file.
  5. If the files are equal, the test passes. Otherwise,
  6. Enable the refresh modus which makes sure that the golden file is overriden by the file resulting from invoking the interface code.
  7. Invoke the interface code (thus refreshing the golden file).
  8. Investigate the outgoing changes in VS's team explorer. If the changes are as desired by our code changes from step 3, commit code changes and golden file. Otherwise, go back to step 3.

This approach works great for us, but it has one drawback: VS only recognizes that the golden files have changed (and thus allows us to investigate the changes) if we use a local workspace. If we use a server workspace, programmatically remove the read-only flag from the golden files and refresh them as described above, VS still does not recognize that the files have changed.

So my question is: Is there any way to make our golden file testing approach work with server workspaces, e.g. by telling VS that some files have changed?

Aucun commentaire:

Enregistrer un commentaire