summaryrefslogtreecommitdiff
path: root/tool/test-bundled-gems.rb
AgeCommit message (Collapse)Author
12 daysRe-enabled repl_type_completor test with upstream fixHiroshi SHIBATA
https://github.com/ruby/repl_type_completor/pull/62 Notes: Merged: https://github.com/ruby/ruby/pull/13211
2025-04-26Implement Set as a core classJeremy Evans
Set has been an autoloaded standard library since Ruby 3.2. The standard library Set is less efficient than it could be, as it uses Hash for storage, which stores unnecessary values for each key. Implementation details: * Core Set uses a modified version of `st_table`, named `set_table`. than `s/st_/set_/`, the main difference is that the stored records do not have values, making them 1/3 smaller. `st_table_entry` stores `hash`, `key`, and `record` (value), while `set_table_entry` only stores `hash` and `key`. This results in large sets using ~33% less memory compared to stdlib Set. For small sets, core Set uses 12% more memory (160 byte object slot and 64 malloc bytes, while stdlib set uses 40 for Set and 160 for Hash). More memory is used because the set_table is embedded and 72 bytes in the object slot are currently wasted. Hopefully we can make this more efficient and have it stored in an 80 byte object slot in the future. * All methods are implemented as cfuncs, except the pretty_print methods, which were moved to `lib/pp.rb` (which is where the pretty_print methods for other core classes are defined). As is typical for core classes, internal calls call C functions and not Ruby methods. For example, to check if something is a Set, `rb_obj_is_kind_of` is used, instead of calling `is_a?(Set)` on the related object. * Almost all methods use the same algorithm that the pure-Ruby implementation used. The exception is when calling `Set#divide` with a block with 2-arity. The pure-Ruby method used tsort to implement this. I developed an algorithm that only allocates a single intermediate hash and does not need tsort. * The `flatten_merge` protected method is no longer necessary, so it is not implemented (it could be). * Similar to Hash/Array, subclasses of Set are no longer reflected in `inspect` output. * RDoc from stdlib Set was moved to core Set, with minor updates. This includes a comprehensive benchmark suite for all public Set methods. As you would expect, the native version is faster in the vast majority of cases, and multiple times faster in many cases. There are a few cases where it is significantly slower: * Set.new with no arguments (~1.6x) * Set#compare_by_identity for small sets (~1.3x) * Set#clone for small sets (~1.5x) * Set#dup for small sets (~1.7x) These are slower as Set does not currently use the AR table optimization that Hash does, so a new set_table is initialized for each call. I'm not sure it's worth the complexity to have an AR table-like optimization for small sets (for hashes it makes sense, as small hashes are used everywhere in Ruby). The rbs and repl_type_completor bundled gems will need updates to support core Set. The pull request marks them as allowed failures. This passes all set tests with no changes. The following specs needed modification: * Modifying frozen set error message (changed for the better) * `Set#divide` when passed a 2-arity block no longer yields the same object as both the first and second argument (this seems like an issue with the previous implementation). * Set-like objects that override `is_a?` such that `is_a?(Set)` return `true` are no longer treated as Set instances. * `Set.allocate.hash` is no longer the same as `nil.hash` * `Set#join` no longer calls `Set#to_a` (it calls the underlying C function). * `Set#flatten_merge` protected method is not implemented. Previously, `set.rb` added a `SortedSet` autoload, which loads `set/sorted_set.rb`. This replaces the `Set` autoload in `prelude.rb` with a `SortedSet` autoload, but I recommend removing it and `set/sorted_set.rb`. This moves `test/set/test_set.rb` to `test/ruby/test_set.rb`, reflecting that switch to a core class. This does not move the spec files, as I'm not sure how they should be handled. Internally, this uses the st_* types and functions as much as possible, and only adds set_* types and functions as needed. The underlying set_table implementation is stored in st.c, but there is no public C-API for it, nor is there one planned, in order to keep the ability to change the internals going forward. For internal uses of st_table with Qtrue values, those can probably be replaced with set_table. To do that, include internal/set_table.h. To handle symbol visibility (rb_ prefix), internal/set_table.h uses the same macro approach that include/ruby/st.h uses. The Set class (rb_cSet) and all methods are defined in set.c. There isn't currently a C-API for the Set class, though C-API functions can be added as needed going forward. Implements [Feature #21216] Co-authored-by: Jean Boussier <[email protected]> Co-authored-by: Oliver Nutter <[email protected]>
2025-04-09Re-enabled to test at win32oleHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/13087
2025-04-07Allow win32ole test failureHiroshi SHIBATA
``` D:/a/ruby/ruby/src/gems/src/win32ole/test/win32ole/test_win32ole_event.rb:80:in 'TestWIN32OLE_EVENT_SWbemSink#default_handler': undefined method '+' for nil (NoMethodError) ``` https://github.com/ruby/ruby/actions/runs/14299035797/job/40072083885?pr=13078 Notes: Merged: https://github.com/ruby/ruby/pull/13078
2025-04-07Rename test command for test-unitHiroshi SHIBATA
https://github.com/test-unit/test-unit/commit/b7d3c32f6e334e1823e30c053c2268893cf073ef Notes: Merged: https://github.com/ruby/ruby/pull/13078
2025-04-04Console Cntl event is sent to root process sharing the consoleNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/13069
2025-04-04Cannot send signal to process group on WindowsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/13069
2025-04-04Cannot send `SIGTERM` to another process on WindowsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/13069
2025-02-05The test of net-smtp-0.5.1 is working with Windows platform nowHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12701
2025-02-05Skip irb on test-bundled-gems with WindowsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12616
2025-01-16Skip win32ole tests without Windows platformHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12583
2024-12-19The test of net-imap is passed with WindowsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12397
2024-12-06typeprof-757303fe8de0cf5e5583b4a76f8abbbd55c44776 is working with WindowsHiroshi SHIBATA
2024-11-28Always declared gems that are test failures on Windows to allowed failures listHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12193
2024-11-27Fixed test condition for specified bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12179
2024-11-27Allow to run 'make test-bundled-gems BUNDLED_GEMS=csv,rexml' for only ↵Hiroshi SHIBATA
testing csv and rexml Notes: Merged: https://github.com/ruby/ruby/pull/12179
2024-11-01Remove debug printNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11969
2024-11-01Make gemspec files for default gems with extensionsNobuyoshi Nakada
So that rubygems can find them as gems. However, the `--install-dir` option of `gem install` seems to exclude prerelease gems, even already installed in that directory, from the dependencies for some reasons; use the `GEM_HOME` environment variable instead. Now net-imap 0.5.0 depends on json gem. Notes: Merged: https://github.com/ruby/ruby/pull/11969
2024-10-28Update test-bundled-gems.rbNobuyoshi Nakada
- Fix filtering by ARGV - Adjust top library names from gem names - Skip if no tests found Notes: Merged: https://github.com/ruby/ruby/pull/11957
2024-01-19Skip test task for resolv-replaceHiroshi SHIBATA
2023-12-25Typofix under lib and test, tool directoriesHiroshi SHIBATA
2023-10-24[Bug #19968] Revert RBS revision to testNobuyoshi Nakada
This reverts the commits for the master branch of RBS: - commit f717faac632dd8664d0967f8e639b84d5d032854: "Update rbs revision to test" The target revision to test is in master branch, not for 3.2.x. - commit 9e93af5329f35092c3de3ea37d4e9e181b800bb2: "Skip RBS `RbConfig::TOPDIR` test that is `nil` before installation" RbConfig_test.rb is not updated in 3.2.x branch.
2023-10-22Skip RBS `RbConfig::TOPDIR` test that is `nil` before installationNobuyoshi Nakada
2023-10-22RBS no longer has test/stdlib/Prime_test.rbNobuyoshi Nakada
2023-08-15Use `::` form workflow commandsNobuyoshi Nakada
2023-06-14Allow test-unit-ruby-core files to be loaded from bundled gemsNobuyoshi Nakada
Separate the directly from the customized test-unit, since it may not work with bundled gems. Notes: Merged: https://github.com/ruby/ruby/pull/7941
2023-06-12Try to skip Prime_test.rbHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7928
2023-06-12Run test-unit test without rake task to avoid yard dependencyHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7928
2023-03-02Fix rbs (#7415)Soutaro Matsumoto
* Update RBS to skip validation task * Revert TEST_BUNDLED_GEMS_ALLOW_FAILURES Notes: Merged-By: soutaro <[email protected]>
2022-12-21Set up RBS_SKIP_TESTS (#6862)Soutaro Matsumoto
* Set up RBS_SKIP_TESTS Notes: Merged-By: soutaro <[email protected]>
2022-12-12Display error messages outside the groups so can be found quicklyNobuyoshi Nakada
2022-11-19Run skipped minitest tests that now passAlan Wu
The mentioned PR was merged. Notes: Merged: https://github.com/ruby/ruby/pull/6768
2022-07-27Do not load library files from repository only for testNobuyoshi Nakada
What we want to test should be the bundled and to be installed files, but not the upstream. Notes: Merged: https://github.com/ruby/ruby/pull/6188 Merged-By: nobu <[email protected]>
2022-07-25Use built bundled gems in test-bundled-gemsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6175
2022-07-24Kill bundled gem tests when interruptedNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6173
2022-07-16Disable parallel built in test-bundled-gemsNobuyoshi Nakada
2022-07-09Use `File::PATH_SEPARATOR` for the portabilityNobuyoshi Nakada
2021-11-15Relax extention name for macOSHiroshi SHIBATA
2021-11-12Bundle RBS 1.7.0 (#5105)Soutaro Matsumoto
* Bundle RBS 1.7.0 * tool/test-bundled-gems.rb: Use a correct path to Check if rbs is built * tool/test-bundled-gems.rb: lib/rbs/parse.y is no longer created Co-authored-by: Yusuke Endoh <[email protected]> Notes: Merged-By: soutaro <[email protected]>
2021-11-09Bundle rbs 1.7.0.beta.5Yusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/5042
2021-10-05introduce debug.gemKoichi Sasada
For the `test-bundled-gems`, make `debug.so` with extconf.rb and `make` command directly because `rake-compiler` assume ruby is installed (but `test-bundled-gems` can run without installation). Notes: Merged: https://github.com/ruby/ruby/pull/4804
2021-08-25tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProfYusuke Endoh
Formerly, TypeProf was tested with the latest RBS code during `make test-bundled-gems`. However, when a new version of rbs is released, and if it is incompatible with TypeProf, `make test-bundled-gems` starts failing, which was annoying. By this change, TypeProf is tested with the bundled version of RBS. Notes: Merged: https://github.com/ruby/ruby/pull/4774
2021-08-24Revert "tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProf"Yusuke Endoh
This reverts commit 22deda43cb98aa3cee48d0bebbff7c4db1d7652a. It was incomplete. Sorry!
2021-08-24tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProfYusuke Endoh
Formerly, TypeProf was tested with the latest RBS code during `make test-bundled-gems`. However, when a new version of rbs is released, and if it is incompatible with TypeProf, `make test-bundled-gems` starts failing, which was annoying. By this change, TypeProf is tested with the bundled version of RBS.
2021-08-07Group commands on GitHub ActionsNobuyoshi Nakada
2021-06-29tool/test-bundled-gems.rb: Stop tests conflicting with error_highlightYusuke Endoh
This hack should be removed after the minitest side is updated. https://github.com/seattlerb/minitest/pull/880 Notes: Merged: https://github.com/ruby/ruby/pull/4586
2020-12-03test-bundled-gems.rb: show failed gems at lastNobuyoshi Nakada
2020-12-02test-bundled-gems: select bundled gems to test by BUNDLED_GEMSNobuyoshi Nakada
2020-10-21extend timeout of rbs test on rbs testsKoichi Sasada
2020-09-23Bundle rbs gem as bundled gems (#3496)Hiroshi SHIBATA
* Added rbs as bundled gems * Added the missing dependencies for rbs gem Notes: Merged-By: soutaro <[email protected]>