ocket8888 opened a new issue #5690:
URL: https://github.com/apache/trafficcontrol/issues/5690


   ## I'm submitting a ...
   -  bug report
   
   ## Traffic Control components affected ...
   -  CI tests
   
   ## Current behavior:
   If a migration is edited in the same PR that creates it, the CI action for 
the database migrations will report that it is out of order, even when it 
isn't. 
   
   ## Expected behavior:
   The tests should account for the possibility that a migration may be edited 
before being merged, and test accordingly.
   
   ## Minimal reproduction of the problem with instructions:
   My PR #5678 displays this behavior. This is because - I think - the test 
script assumes that `git --no-pager log --format=%ct 
2021032600000000_dsrs_originals.sql` is going to output one line, the time of 
creation of the migration. It then adds this to an array, and later compares it 
against the latest modification time of any migration using `git log -1 
--name-status --format="%ct" . | head -n 1` with `!=`. So essentially it's 
comparing
   ```bash
   mtime_array+=( "$(git --no-pager log --format=%ct 
2021032600000000_dsrs_originals.sql)" )
   mtime_length=${#mtime_array[@]}
   echo ${mtime_array[$mtime_length-1]}
   # Outputs: 1617049981 1616777950
   ```
   to
   ```bash
   git log -1 --name-status --format="%ct" . | head -n 1
   # Outputs: 1617049981
   ```
   Which you can see is lining up with _part_ of the `mtime_array` entry, but 
will never be exactly equal because the entry has two numbers.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to