AnsweredAssumed Answered

Testing with HCI harness

Question asked by Harpreet Kalsi on Jan 10, 2018
Latest reply on Jan 10, 2018 by Yury Kats

Hello,

 

It sounds like a good practice not calling ConnectorPlugin::getMetadata() in the ConnectorPlugin::list() method - reducing amount of network operation and a risks of failure.

According to the list()'s documentation:

This method MUST return Documents with the following required fields set:

  • StandardFields.ID - Globally unique identifier for this document
  • StandardFields.URI - Unique resource from the data source used to retrieve this document w/o the plugin (case-insensitive portions should be lowercased)
  • StandardFields.DISPLAY_NAME - The user-visible display name of this document
  • StandardFields.VERSION - A value that should change whenever the document changes

That the minimum I can set in list() without accessing the actual storage (no fetching any real file's metadata).

But in the getMetadata() I actually read everything and set about 40 props (vs just 4 required in list()). This caused test harness failure:

 

2018-01-10 16:59:29 DEBUG  Comparing document fields: getMetadata vs. list

2018-01-10 16:59:29 ERROR  *** ERROR *** : Document field mismatch: getMetadata: Missing MY_TAG_Data_Content from list output

2018-01-10 16:59:29 ERROR  *** ERROR *** : Document field mismatch: getMetadata: Missing HCI_path from list output

 

So there are two questions:

1. Is it really a good approach in producing a minimal document in list() and then generate a full one in getMetadata()? If it is, then how to deal with test harness errors?

2. Is it OK rewriting VERSION prop in getMetadata() for all documents received from list()? I do not have any information about a file in my list() methods excepts its Path/ID.

Outcomes