Testing an update hook that updates fields? I wrote an update hook for a site that moves data from one field to another. It looks a lot like this gist:

  foreach ($node_ids as $node_id) {
    try {
      $node_wrapper = entity_metadata_wrapper('node', $node_id);
      $node_wrapper-&gt;field_new_field-&gt;set($node_wrapper-&gt;field_old_field[0]-&gt;value());
      $node_wrapper-&gt;save();
    }
    catch (Exception $e) {
      watchdog('mymodule', 'Problem with node @node_id', array('@node_id' =&gt; $node_id), WATCHDOG_ERROR);
    }
    $sandbox['progress']++;
  }


It's being tested on CI (Travis) which runs "drush updatedb -y" so what I was wondering is if there is a way to query a particular node and make sure the field is populated? Like for example make sure the data in field_new_field is the same as _field_old_field and printing that on the command line?
Yes, very quickly. You already have part of the code. Since you have already loaded the node via the entity_metadata_wrapper() you have all of the information at your finger tips.

An example is this in your hook_update_N()

foreach ($node_ids as $node_id) {
    try {
      $node_wrapper = entity_metadata_wrapper('node', $node_id);
      $node_wrapper-&gt;field_new_field-&gt;set($node_wrapper-&gt;field_old_field[0]-&gt;value());
      $node_wrapper-&gt;save();
      if ($node_wrapper-&gt;field_new_field-&gt;value() == $node_wrapper-&gt;field_old_field-&gt;value()){
        print_r('Success. Old field data is in new field data');
      }
    }
    catch (Exception $e) {
      watchdog('mymodule', 'Problem with node @node_id', array('@node_id' =&gt; $node_id), WATCHDOG_ERROR);
    }
    $sandbox['progress']++;
  }


I added a comparison of the old field data and the new field data. If it is the same, it will print 'Success. Old field data is in new field data' in the console of Travis-CI. You can do this for any entity. You can use print_r() to output data that you can see in Travis-CI's console. I do this for troubleshooting my test scripts when I may be using a new test method I have never used before and I want to see what Drupal is giving me. Most of the modules I maintain on D.O are tested with Travis-CI.