Skip to content

Add integration parity coverage and normalize test suite to task CE in FSharp.Control.R3#12

Draft
Copilot wants to merge 18 commits into
mainfrom
copilot/cover-functionality-with-integration-tests
Draft

Add integration parity coverage and normalize test suite to task CE in FSharp.Control.R3#12
Copilot wants to merge 18 commits into
mainfrom
copilot/cover-functionality-with-integration-tests

Conversation

Copy link
Copy Markdown

Copilot AI commented May 23, 2026

  • Inspect current Observable/AsyncObservable/TaskObservable test layout and baseline validation status
  • Regroup Observable tests into category-based files to match the project convention
  • Remove old per-feature Observable test files replaced by grouped category files
  • Run targeted Observable test project validation
  • Run final validation checks

Copilot AI linked an issue May 23, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add integration tests for existing functionality Add integration parity tests for FSharp.Control.R3 wrappers vs native R3 behavior May 23, 2026
Copilot AI requested a review from xperiandri May 23, 2026 16:44
Comment on lines +21 to +25
let expectedSource = IntegrationParityTests.CreateSourceObservable ()
let expectedFiltered = R3.ObservableExtensions.Where (expectedSource, fun x -> x % 2 = 0)
let expectedSelected = R3.ObservableExtensions.Select (expectedFiltered, fun x -> x * 10)
let expectedSkipped = R3.ObservableExtensions.Skip (expectedSelected, 1)
let expectedPipeline = R3.ObservableExtensions.Take (expectedSkipped, 1)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot why not write original the same as F#?

Suggested change
let expectedSource = IntegrationParityTests.CreateSourceObservable ()
let expectedFiltered = R3.ObservableExtensions.Where (expectedSource, fun x -> x % 2 = 0)
let expectedSelected = R3.ObservableExtensions.Select (expectedFiltered, fun x -> x * 10)
let expectedSkipped = R3.ObservableExtensions.Skip (expectedSelected, 1)
let expectedPipeline = R3.ObservableExtensions.Take (expectedSkipped, 1)
let expectedPipeline =
IntegrationParityTests.CreateSourceObservable ()
|> _.Where(fun x -> x % 2 = 0)
|> _.Select(fun x -> x * 10)
|> _.Skip(1)
|> _.Take(1)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 890893c. I changed the expected (direct R3) pipeline to fluent instance-style calls (source.Where/Select/Skip/Take) to keep it closer to idiomatic F# while still compiling reliably in this test context.

Comment thread tests/FSharp.Control.R3.Tests/IntegrationParityTests.fs Outdated
Comment on lines +15 to +23
member _.``mapAsync should transform each value`` () =
let options = ProcessingOptions.Default
let source = TestHelpers.createObservable [| 1; 2; 3 |]
let actual =
source
|> Observable.mapAsync options (fun (_ : CancellationToken) x -> Task.FromResult (x + 1))
|> TestHelpers.toArrayTask
|> TestHelpers.waitTask
CollectionAssert.AreEqual ([| 2; 3; 4 |], actual, "Task mapAsync must transform each source value.")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot whay here don't you have a normal task CE shape test?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 1b7300e: rewrote this test to a normal task CE shape (: Task = task { let! ... }) and removed |> TestHelpers.waitTask.

let! actual =
source
|> Observable.aggregate 0 (fun acc x -> acc + x)
|> Async.StartAsTask
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot
поставь в тесты <PackageReference Include="FSharp.Control.FusionTasks" Version="2.6.0" /> тогда не нужно будет писать |> Async.StartAsTask и поубирай эти вызовы

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сделал в e824222: добавил FSharp.Control.FusionTasks в тестовый проект и убрал вызовы Async.StartAsTask из AsyncObservable тестов, переведя их на прямой let!/do! в task CE.

Copilot AI requested a review from xperiandri May 24, 2026 15:04
Copilot AI changed the title Add integration parity test coverage and async test task-CE cleanup for FSharp.Control.R3 Add integration parity coverage and normalize test suite to task CE in FSharp.Control.R3 May 24, 2026
Copilot AI and others added 18 commits May 24, 2026 17:38
Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Control.R3/sessions/a6751a07-082f-4b6d-a346-d2b4f5d5f694

Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Control.R3/sessions/244a22d1-52fa-4b08-b7b2-729a28a43b65

Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Control.R3/sessions/408d36f0-589c-4395-8c1e-75d8acdbe389

Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
@xperiandri xperiandri force-pushed the copilot/cover-functionality-with-integration-tests branch from 068757d to 4935a5b Compare May 24, 2026 15:38
@xperiandri xperiandri requested a review from Copilot May 24, 2026 15:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the test suite for FSharp.Control.R3 to provide category-based coverage across Observable, AsyncObservable, and TaskObservable, while adding targeted validation for ProcessingOptions/ChunkConfiguration.

Changes:

  • Added shared TestHelpers and introduced new category-based test files under Observable/, AsyncObservable/, and TaskObservable/.
  • Added new ProcessingOptionsTests to validate ChunkConfiguration helpers.
  • Updated the test project file layout and added a new package reference/version entry.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/FSharp.Control.R3.Tests/TestHelpers.fs Adds shared helpers for creating observables and collecting results for assertions.
tests/FSharp.Control.R3.Tests/TaskObservable/TransformationCategoryTests.fs Adds Task-based transformation tests (mapAsync, iter, iterAsync).
tests/FSharp.Control.R3.Tests/TaskObservable/SingleElementCategoryTests.fs Adds Task-based single-element test (firstAsync).
tests/FSharp.Control.R3.Tests/TaskObservable/AllSelectionCategoryTests.fs Adds Task-based selection tests (all, existsAsync).
tests/FSharp.Control.R3.Tests/TaskObservable/AggregationCategoryTests.fs Adds Task-based aggregation tests (aggregate, length).
tests/FSharp.Control.R3.Tests/ProcessingOptionsTests.fs Adds tests for ChunkConfiguration helpers and default time provider behavior.
tests/FSharp.Control.R3.Tests/ObservableTests.fs Removes the prior monolithic Observable test file.
tests/FSharp.Control.R3.Tests/Observable/TransformationCategoryTests.fs Adds category-based transformation tests (map, bind, mapi).
tests/FSharp.Control.R3.Tests/Observable/SingleElementCategoryTests.fs Adds category-based single-element tests (singleton, empty).
tests/FSharp.Control.R3.Tests/Observable/ConversionCategoryTests.fs Adds category-based conversion tests (asObservable, cast, ofType).
tests/FSharp.Control.R3.Tests/Observable/AllSelectionCategoryTests.fs Adds category-based selection tests (where, filter, choose, distinct, chunkBy*, skip, take).
tests/FSharp.Control.R3.Tests/Observable/AggregationCategoryTests.fs Adds category-based aggregation tests (concat, merge, catch).
tests/FSharp.Control.R3.Tests/FSharp.Control.R3.Tests.fsproj Switches to wildcard compile includes, adds new folders/files, and adds a FusionTasks reference.
tests/FSharp.Control.R3.Tests/BuilderTests.fs Removes the prior builder/rxquery test file.
tests/FSharp.Control.R3.Tests/AsyncObservable/TransformationCategoryTests.fs Adds async-observable transformation tests and parity checks against direct R3 APIs.
tests/FSharp.Control.R3.Tests/AsyncObservable/SingleElementCategoryTests.fs Adds async-observable single-element test (firstAsync).
tests/FSharp.Control.R3.Tests/AsyncObservable/ConversionCategoryTests.fs Adds async-observable conversion tests (toArray, toList).
tests/FSharp.Control.R3.Tests/AsyncObservable/AllSelectionCategoryTests.fs Adds async-observable selection tests (all, existsAsync).
tests/FSharp.Control.R3.Tests/AsyncObservable/AggregationCategoryTests.fs Adds async-observable aggregation tests (aggregate, length).
Directory.Packages.props Adds centrally-managed version entry for FSharp.Control.FusionTasks.
Comments suppressed due to low confidence (1)

tests/FSharp.Control.R3.Tests/FSharp.Control.R3.Tests.fsproj:21

  • FSharp.Control.FusionTasks was added to the test project, but the updated tests appear to use the built-in task {} CE (from FSharp.Core) and don’t reference FusionTasks APIs. If it’s not needed, removing this dependency will reduce restore/build surface area.
    <PackageReference Include="altcover" />
    <PackageReference Include="FSharp.Control.FusionTasks" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" />
    <PackageReference Include="MSTest.TestAdapter" />
    <PackageReference Include="MSTest.TestFramework" />
    <PackageReference Include="Unquote" />

Comment on lines +8 to +12
<Compile Include="TestHelpers.fs" />
<Compile Include="Observable/*.fs" />
<Compile Include="AsyncObservable/*.fs" />
<Compile Include="TaskObservable/*.fs" />
<Compile Include="ProcessingOptionsTests.fs" />
Comment on lines +8 to +12
<Compile Include="TestHelpers.fs" />
<Compile Include="Observable/*.fs" />
<Compile Include="AsyncObservable/*.fs" />
<Compile Include="TaskObservable/*.fs" />
<Compile Include="ProcessingOptionsTests.fs" />
Comment thread Directory.Packages.props
<PackageVersion Include="Fake.DotNet.Paket" Version="6.1.4" />
<PackageVersion Include="Fake.IO.FileSystem" Version="6.1.4" />
<PackageVersion Include="Fake.Tools.Git" Version="6.1.4" />
<PackageVersion Include="FSharp.Control.FusionTasks" Version="2.6.0" />
Comment on lines +4 to +6
open global.FSharp.Control
open Microsoft.VisualStudio.TestTools.UnitTesting
open global.R3
Comment on lines +4 to +6
open global.FSharp.Control
open Microsoft.VisualStudio.TestTools.UnitTesting
open global.R3
Comment on lines +4 to +6
open global.FSharp.Control
open Microsoft.VisualStudio.TestTools.UnitTesting
open global.R3
Comment on lines +4 to +6
open global.FSharp.Control
open Microsoft.VisualStudio.TestTools.UnitTesting
open global.R3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover the functionality with integration tests

3 participants