cyjoelchen / php-sweph

PHP Extension for Swiss Ephemeris
Other
63 stars 29 forks source link

make test with 1 failure on swe_lun_occult.phpt #95

Closed AstroSign-Dev closed 1 year ago

AstroSign-Dev commented 1 year ago

during make test on Mac M1 Max and OS Mac Ventura I got 1 error:

FAILED TEST SUMMARY

Basic test [tests/swe_lun_occult.phpt]

Computer config:

PHP : /opt/homebrew/Cellar/php/8.2.6/bin/php PHP_SAPI : cli PHP_VERSION : 8.2.6 ZEND_VERSION: 4.2.6 PHP_OS : Darwin - Darwin studio.local 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000 arm64 INI actual : /Users/name/swephp/php-sweph/tmp-php.ini More .INIs :

kevindecapite commented 1 year ago

I am also seeing the failure running the same setup as yours (albeit via Docker). My main workstation is an older iMac running an Intel chip; but I do see the failing test on my M1 laptop.

swe_lun_occult.diff

--
       ["attr"]=>
       array(8) {
         [0]=>
045+     float(86.75744)
045-     float(86.757453)
         [1]=>
         float(172.526684)
         [2]=>
--

This is only a minor precision issue. I'll update the test assertions to use less precision since we really don't care about that for these tests.

The extension should still work fine as-is, however.

kevindecapite commented 1 year ago

@AstroSign-Dev

Is your swe_heliacal_ut.phpt test failing also? I'm actually getting entirely different days on my M1, which doesn't seem right:

--
       ["rc"]=>
       int(0)
       [0]=>
005+   float(2452587.41)
005-   float(2452586.417484)
       [1]=>
007+   float(2452587.419)
007-   float(2452586.424)
       [2]=>
009+   float(2452587.432)
009-   float(2452586.43135)
     }

For some reason, the function is now calculating the rising times for one (1) day later than the assertions. I checked with swetest on Astrodienst's website and the 2452586.* values are what it's outputting.

I'd like to know what your system is showing.

AstroSign-Dev commented 1 year ago

I tried make test on both, M1 Max and M2 with macOS 13.4 and PHP 8.26. In both cases only swe_lun_occult.phpt failed the test. On my Intel i9 Mac it passes all tests, no errors there.

-- ["attr"]=> array(8) { [0]=> 045+ float(86.757447) 045- float(86.757453) [1]=> float(172.526684) [2]=>

kevindecapite commented 1 year ago

Ok it looks like you're using Homebrew to manage PHP, correct?

I'm using Docker so perhaps that's impacting the values somehow. I'll experiment with a brew install on my M1 and maybe even on my Intel Mac to see what I get.