ace-support-test-helpers 0.13.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +12 -0
- data/lib/ace/test_support/coverage.rb +1 -1
- data/lib/ace/test_support/fixtures/bundle_mocks.rb +1 -1
- data/lib/ace/test_support/fixtures/git_mocks.rb +1 -1
- data/lib/ace/test_support/sandbox_package_copy.rb +75 -0
- data/lib/ace/test_support/version.rb +1 -1
- data/lib/ace/test_support.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93f08baa1e63663701ef39c9f56eac0a349bbd38328e9463d152a8a69de84ef0
|
|
4
|
+
data.tar.gz: de3ee440f9ccc69516c175b280d8e985d7d38568487e9fd407776d59f751b0a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0be35ba10e00f96cb0ef286b0d86fb799bc332d46c8f38ee5eca93a4f55b01965e2b88a6bd2d759ea81798a03916d5b55a15b534e52bb390c17d23f402111dd4
|
|
7
|
+
data.tar.gz: 46155426b67b848c9c8678f0dccaadabab12cf4cb131d3e8d6f8177646773a839a3c86651b5dc788a1756802dd4c8b9f55e59201d5bbc0e5ba7b82e17375ed99
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.14.2] - 2026-04-13
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **ace-support-test-helpers v0.14.2**: Standardized shared package tests to the fast-only layout and updated testing flow defaults.
|
|
15
|
+
|
|
16
|
+
### Technical
|
|
17
|
+
- Relaxed config-helper version assertions to validate semantic-version shape instead of a pinned placeholder value.
|
|
18
|
+
## [0.14.1] - 2026-04-11
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Migrated deterministic tests from `test/{atoms,molecules,fixtures}` to `test/fast/{atoms,molecules,fixtures}` to align with the fast/feat/e2e model as a fast-only package.
|
|
22
|
+
- Updated README testing guidance to document the fast-only contract and canonical `ace-test` commands for this package.
|
|
23
|
+
|
|
24
|
+
## [0.14.0] - 2026-04-10
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- Added `SandboxPackageCopy`, a reusable helper for copying a target package into an isolated sandbox and owning the sandbox environment contract for restarted E2E flows.
|
|
28
|
+
|
|
10
29
|
## [0.13.1] - 2026-03-29
|
|
11
30
|
|
|
12
31
|
### Technical
|
data/README.md
CHANGED
|
@@ -24,6 +24,18 @@
|
|
|
24
24
|
|
|
25
25
|
**Improve CI stability** - reduce flaky test behavior with shared deterministic helpers for directory management, configuration, and environment cleanup.
|
|
26
26
|
|
|
27
|
+
## Testing Contract
|
|
28
|
+
|
|
29
|
+
This package is **fast-only** in the ACE testing model.
|
|
30
|
+
|
|
31
|
+
- Deterministic coverage lives under `test/fast/`.
|
|
32
|
+
- This migration does not introduce `test/feat/` or `test/e2e/` for this package.
|
|
33
|
+
|
|
34
|
+
Run:
|
|
35
|
+
|
|
36
|
+
- `ace-test ace-support-test-helpers`
|
|
37
|
+
- `ace-test ace-support-test-helpers all`
|
|
38
|
+
|
|
27
39
|
---
|
|
28
40
|
|
|
29
41
|
Part of [ACE](https://github.com/cs3b/ace)
|
|
@@ -33,7 +33,7 @@ module Ace
|
|
|
33
33
|
# Ace::TestSupport::Coverage.start('ace-search', minimum_coverage: 85)
|
|
34
34
|
#
|
|
35
35
|
# @example Additional groups
|
|
36
|
-
# Ace::TestSupport::Coverage.start('ace-
|
|
36
|
+
# Ace::TestSupport::Coverage.start('ace-task', groups: {
|
|
37
37
|
# 'CLI' => 'lib/ace/taskflow/cli'
|
|
38
38
|
# })
|
|
39
39
|
def self.start(gem_name, options = {})
|
|
@@ -62,7 +62,7 @@ module Ace
|
|
|
62
62
|
This mock content provides enough substance to satisfy
|
|
63
63
|
integration test requirements while avoiding the 30-second
|
|
64
64
|
delay caused by executing expensive shell commands like
|
|
65
|
-
ace-
|
|
65
|
+
ace-task queries and recursive directory scans.
|
|
66
66
|
|
|
67
67
|
By mocking ace-bundle, we achieve 10x faster test execution
|
|
68
68
|
without sacrificing test coverage or reliability.
|
|
@@ -136,7 +136,7 @@ module Ace
|
|
|
136
136
|
Ace::Core.define_singleton_method(:get, original) if original
|
|
137
137
|
end
|
|
138
138
|
|
|
139
|
-
# Stub ace-
|
|
139
|
+
# Stub ace-task CLI output
|
|
140
140
|
# @param task_id [String] The task ID
|
|
141
141
|
# @param output [String] The taskflow output
|
|
142
142
|
# @yield Block where the stub is active
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "fileutils"
|
|
4
|
+
|
|
5
|
+
module Ace
|
|
6
|
+
module TestSupport
|
|
7
|
+
# Creates deterministic E2E sandboxes and copies package sources into them.
|
|
8
|
+
class SandboxPackageCopy
|
|
9
|
+
DEFAULT_SANDBOX_BASE = ".ace-local/test-e2e"
|
|
10
|
+
|
|
11
|
+
def initialize(source_root: Dir.pwd, sandbox_base: DEFAULT_SANDBOX_BASE)
|
|
12
|
+
@source_root = File.expand_path(source_root)
|
|
13
|
+
@sandbox_base = File.expand_path(sandbox_base, @source_root)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Prepare a sandbox and copy a package into it.
|
|
17
|
+
#
|
|
18
|
+
# Exactly one of sandbox_name or sandbox_root must be provided.
|
|
19
|
+
#
|
|
20
|
+
# @param package_name [String] package directory to copy
|
|
21
|
+
# @param sandbox_name [String, nil] sandbox folder name under .ace-local/test-e2e
|
|
22
|
+
# @param sandbox_root [String, nil] explicit sandbox path
|
|
23
|
+
# @return [Hash] sandbox_root, package_root, source_root, and env contract
|
|
24
|
+
def prepare(package_name:, sandbox_name: nil, sandbox_root: nil)
|
|
25
|
+
package = package_name.to_s.strip
|
|
26
|
+
raise ArgumentError, "package_name is required" if package.empty?
|
|
27
|
+
|
|
28
|
+
root = resolve_sandbox_root(sandbox_name: sandbox_name, sandbox_root: sandbox_root)
|
|
29
|
+
source_package = File.join(@source_root, package)
|
|
30
|
+
target_package = File.join(root, package)
|
|
31
|
+
|
|
32
|
+
unless File.directory?(source_package)
|
|
33
|
+
raise ArgumentError, "Package source directory not found: #{source_package}"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
FileUtils.mkdir_p(root)
|
|
37
|
+
FileUtils.cp_r(source_package, target_package) unless File.exist?(target_package)
|
|
38
|
+
|
|
39
|
+
{
|
|
40
|
+
sandbox_root: root,
|
|
41
|
+
package_root: target_package,
|
|
42
|
+
source_root: @source_root,
|
|
43
|
+
env: {
|
|
44
|
+
"PROJECT_ROOT_PATH" => root,
|
|
45
|
+
"ACE_E2E_SOURCE_ROOT" => @source_root
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
def resolve_sandbox_root(sandbox_name:, sandbox_root:)
|
|
53
|
+
if sandbox_name && sandbox_root
|
|
54
|
+
raise ArgumentError, "Specify only one of sandbox_name or sandbox_root"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
if sandbox_name
|
|
58
|
+
name = sandbox_name.to_s.strip
|
|
59
|
+
raise ArgumentError, "sandbox_name cannot be empty" if name.empty?
|
|
60
|
+
|
|
61
|
+
return File.join(@sandbox_base, name)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
if sandbox_root
|
|
65
|
+
root = sandbox_root.to_s.strip
|
|
66
|
+
raise ArgumentError, "sandbox_root cannot be empty" if root.empty?
|
|
67
|
+
|
|
68
|
+
return File.expand_path(root)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
raise ArgumentError, "Either sandbox_name or sandbox_root is required"
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
data/lib/ace/test_support.rb
CHANGED
|
@@ -14,6 +14,7 @@ require_relative "test_support/subprocess_runner" # Subprocess isolation utilit
|
|
|
14
14
|
require_relative "test_support/base_test_case" # Then base test case that uses it
|
|
15
15
|
require_relative "test_support/config_helpers"
|
|
16
16
|
require_relative "test_support/test_environment"
|
|
17
|
+
require_relative "test_support/sandbox_package_copy"
|
|
17
18
|
require_relative "test_support/performance_helpers" # Performance testing utilities
|
|
18
19
|
require_relative "test_support/fixtures/bundle_mocks" # Shared bundle mocks
|
|
19
20
|
require_relative "test_support/fixtures/git_mocks" # Shared git mocks
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ace-support-test-helpers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michal Czyz
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-04-20 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: minitest
|
|
@@ -62,6 +62,7 @@ files:
|
|
|
62
62
|
- lib/ace/test_support/fixtures/prompt_helpers.rb
|
|
63
63
|
- lib/ace/test_support/fixtures/test_runner_mocks.rb
|
|
64
64
|
- lib/ace/test_support/performance_helpers.rb
|
|
65
|
+
- lib/ace/test_support/sandbox_package_copy.rb
|
|
65
66
|
- lib/ace/test_support/subprocess_runner.rb
|
|
66
67
|
- lib/ace/test_support/test_environment.rb
|
|
67
68
|
- lib/ace/test_support/test_helper.rb
|