Support running against Phel#873
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Phel (PHP) as a supported dialect for running the Clojure core test suite, including CI coverage and documentation to set up the Phel environment locally.
Changes:
- Add Phel-specific reader-conditional branches across many core tests to account for missing/variant features (vars, ratios, MapEntry representation, numeric predicates, etc.).
- Introduce Composer + Phel configuration/docs for running the suite under PHP.
- Extend GitHub Actions CI to run the suite via
phel teston a PHP version matrix.
Reviewed changes
Copilot reviewed 45 out of 46 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| test/clojure/core_test/vec.cljc | Skip/adjust array aliasing expectations for Phel. |
| test/clojure/core_test/var_qmark.cljc | Skip var? tests on Phel (no vars yet). |
| test/clojure/core_test/val.cljc | Adjust MapEntry representation for Phel. |
| test/clojure/core_test/uuid_qmark.cljc | Adjust non-UUID cases for Phel UUID string behavior. |
| test/clojure/core_test/taps.cljc | Treat Phel awaitables as pending for tap delivery behavior. |
| test/clojure/core_test/symbol.cljc | Skip var-based symbol tests for Phel. |
| test/clojure/core_test/string_qmark.cljc | Add Phel-specific cases for class/string and char behavior. |
| test/clojure/core_test/str.cljc | Adjust decimal string formatting expectations for Phel. |
| test/clojure/core_test/star.cljc | Skip rational tests for Phel. |
| test/clojure/core_test/special_symbol_qmark.cljc | Adjust special symbol set to match Phel capabilities. |
| test/clojure/core_test/slash.cljc | Adjust multi-arg division and skip rational tests for Phel. |
| test/clojure/core_test/short.cljc | Skip short-specific instance checks for Phel. |
| test/clojure/core_test/seqable_qmark.cljc | Mark chars seqable? for Phel. |
| test/clojure/core_test/repeat.cljc | Adjust fractional repeat behavior for Phel. |
| test/clojure/core_test/remove_watch.cljc | Skip var/ref/agent watch tests for Phel. |
| test/clojure/core_test/reduce.cljc | Add Phel numeric interop mappings and expected results. |
| test/clojure/core_test/ratio_qmark.cljc | Skip ratio tests for Phel. |
| test/clojure/core_test/print_str.cljc | Align print-str output expectations for Phel. |
| test/clojure/core_test/pos_int_qmark.cljc | Adjust bigint classification for Phel. |
| test/clojure/core_test/portability.cljc | Add Phel branches for big-int? logic, sleep, and thrown? catching. |
| test/clojure/core_test/plus.cljc | Skip rational tests for Phel. |
| test/clojure/core_test/parents.cljc | Add Phel class/type inheritance parent expectations. |
| test/clojure/core_test/neg_int_qmark.cljc | Adjust bigint classification for Phel. |
| test/clojure/core_test/minus.cljc | Skip rational tests for Phel. |
| test/clojure/core_test/key.cljc | Adjust MapEntry representation for Phel. |
| test/clojure/core_test/integer_qmark.cljc | Adjust integer? expectations around ratios for Phel. |
| test/clojure/core_test/int_qmark.cljc | Adjust int? expectations for bigints/ratios in Phel. |
| test/clojure/core_test/inc.cljc | Add Phel overflow behavior expectation. |
| test/clojure/core_test/float_qmark.cljc | Adjust float? expectations for Phel decimals/ratios. |
| test/clojure/core_test/float.cljc | Adjust float behavior expectations for Phel. |
| test/clojure/core_test/eq.cljc | Treat regex eq semantics as true for Phel. |
| test/clojure/core_test/double_qmark.cljc | Adjust double? expectations for Phel. |
| test/clojure/core_test/derive.cljc | Use Phel class tags for derive/isa? tests. |
| test/clojure/core_test/dec.cljc | Add Phel underflow expectation (currently flawed per review). |
| test/clojure/core_test/char_qmark.cljc | Add Phel-specific char? expectations. |
| test/clojure/core_test/case.cljc | Add Phel-specific case dispatch expectations for numeric types. |
| test/clojure/core_test/associative_qmark.cljc | Adjust associative? expectations for Phel seq/arrays. |
| test/clojure/core_test/ancestors.cljc | Add Phel class/type inheritance expectations (contains a malformed conditional per review). |
| test/clojure/core_test/add_watch.cljc | Adjust exception class and skip unsupported watch cases for Phel. |
| test/clojure/core_test/aclone.cljc | Adjust aclone identity expectations for Phel array semantics. |
| phel-config.php | Configure Phel test directory to use repo’s test/. |
| doc/phel.md | Document how to install/run tests and update Phel via Composer. |
| composer.json | Add Composer dependency on phel-lang/phel-lang. |
| README.md | Link to Phel setup documentation. |
| .gitignore | Ignore Composer vendor/ directory. |
| .github/workflows/ci.yml | Add a test-phel CI job running Phel tests on a PHP matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,6 @@ | |||
| { | |||
| "require": { | |||
| "phel-lang/phel-lang": "dev-main" | |||
There was a problem hiding this comment.
Using dev-main without committing a composer.lock makes CI and local runs non-deterministic (upstream Phel changes can break the suite without any change in this repo). If stability is desired, pin to a tagged release or a specific commit and commit the resulting composer.lock; if tracking HEAD is desired, consider documenting/handling the expected flakiness explicitly.
| "phel-lang/phel-lang": "dev-main" | |
| "phel-lang/phel-lang": "dev-main#<tested-commit-sha>" |
There was a problem hiding this comment.
"phel-lang/phel-lang": "dev-main" is intended so that fixing breakage on Phel side wouldn't require updating the pinned commit here.
| (def AncestorT #?(:cljs js/Object :lpy python/object :default Object)) | ||
| (def ChildT #?(:cljs :default :lpy basilisp.lang.set/PersistentSet :default clojure.lang.PersistentHashSet)) | ||
| (def AncestorT #?(:cljs js/Object :lpy python/object :phel ArrayIterator :default Object)) | ||
| (def ChildT #?(:cljs :default :lpy basilisp.lang.set/PersistentSet :phel RecursiveArrayIterator :default clojure.lang.PersistentHashSet)) |
There was a problem hiding this comment.
ChildT's reader conditional looks malformed: the :cljs branch evaluates to the keyword :default, and there are two :default clauses. This makes ChildT a keyword in CLJS rather than a class/type and is likely unintended. Replace the :cljs branch with an actual CLJS class (or remove the :cljs clause) and keep only one :default clause.
| (def ChildT #?(:cljs :default :lpy basilisp.lang.set/PersistentSet :phel RecursiveArrayIterator :default clojure.lang.PersistentHashSet)) | |
| (def ChildT #?(:cljs js/Array :lpy basilisp.lang.set/PersistentSet :phel RecursiveArrayIterator :default clojure.lang.PersistentHashSet)) |
There was a problem hiding this comment.
Valid point regarding :cljs branch that it may be confusing but it's not related to this PR and should be resolved separately.
Clojure-like Lisp compiling to PHP For non-squashed commit history see archived branch at: https://github.com/phel-lang/clojure-test-suite/tree/phel-integration Co-authored-by: Chemaclass <chemaclass@outlook.es> Co-authored-by: Jesus Valera Reales <github@jesusvalera.dev>
|
Fixed the typos and did couple suggested changes. Thank's. CI runs ok https://github.com/phel-lang/clojure-test-suite/actions/runs/25230564223 |
Includes changes from https://github.com/phel-lang/clojure-test-suite/tree/phel-integration as a single squashed commit.
Open question: include both 8.4 and 8.5 in test matrix? Background in Slack https://clojurians.slack.com/archives/C0A2CQQQVPB/p1777553801232369?thread_ts=1775891783.135539&cid=C0A2CQQQVPB