Commit graph

35 commits

Author SHA1 Message Date
Craig Fowler a81d47afff Resolve #785 - improve API for StringValuesModel
This means that the model:
* Implements IConvertible so that Jint may implicitly convert
  it to other types as if it were just a string.
* The Values & Values properties are perhaps a little less confusing
  now, and present a more consistent set of state, regardless of
  the inner model.
* There's a minor simplification to ToString, since String.Join already
  did what we wanted for one or many values.

Notable though is - because this class implements IConvertible,
it is no longer CLS compliant.  We do not currently mark this assembly
as CLS complient so as things stand that's OK.  I do not know if there
are any plans/expectations for CLS compliance in Elsa.

If we do plan to mark the assemblies as compliant then we must mark this
class [CLSCompliant(false)].
2021-03-25 21:10:25 +00:00
Craig Fowler ee7a8cdb1b
Merge pull request #775 from craigfowler/feature/738-Composite-Activities-may-be-triggers
Refactor for comprehension & add test coverage
2021-03-20 11:29:28 +00:00
Craig Fowler 3943e64c70 WIP #738 - Add test coverage to replace big test
The large/complex test is now removed, replaced by
smaller/simpler unit tests for the individual units in
the overall process of getting triggers.
2021-03-19 19:45:16 +00:00
Craig Fowler 6700ac2402 WIP #738 - Simplify unit test
Now that the class is a little less complex, this
simplified unit test covers just what remains.
2021-03-18 21:22:19 +00:00
Craig Fowler 9ec698c7bc WIP #738 - Refactor a troublesome extension method
This extension method is quite complex and is frustrating
when a unit test passes-through it.  That's because extension
methods can't be mocked in tests.
2021-03-18 21:09:04 +00:00
Craig Fowler d9724e5267 WIP #738 - Refactor-out a further service
The triggers-for-activity-blueprint functionality
is quite complex just on its own, so I have moved this to
a new service.

Once again the integration test which is left behind proves
that it still does the same job.
2021-03-18 20:29:06 +00:00
Craig Fowler 654f3072d9 WIP #738 - Refactor some logic into services
This simplifies the unit a little and the test proves that
it still does the same thing overall.  Strictly speaking, this
is now an integration test.
2021-03-18 19:35:05 +00:00
Craig Fowler 1dee17b904 WIP #738 - Add test coverage for new service
This test passes, but as you can see it's
massive because of the complexity of what the
class has to do.
2021-03-18 18:54:23 +00:00
Sipke Schoorstra 0434b4825a Update packages 2021-03-18 11:24:04 +01:00
Craig Fowler 8751bead5a WIP #728 - Make WorkflowBurst default behaviour
In the comments to #728 it was suggested that
WorkflowBurst persistence behaviour was a more
sane default.
2021-03-09 19:57:45 +00:00
Craig Fowler e340a37d93 Resolve #486 - Signal input is emitted as output
It actually turns out that no change is required to the SignalReceived
activity in order to achieve this.  As these unit tests prove & document,
that is already the current behaviour.
2021-02-27 20:00:54 +01:00
Craig Fowler df83b9a1de WIP #665 - Beginnings of SonarCloud integration
Adds an XUnit test logger to each test csproj
file (will be used by test script).

Also add a skeleton SonarCloud analysis config file with a couple
of settings for starters: Don't analyse exception classes or samples
for coverage.
2021-02-27 14:33:45 +00:00
Craig Fowler 8d4339f4b0 Revert "Merge branch 'feature/665-SonarCloud-integration' into feature/elsa-2.0"
This reverts commit 3dc1b79b3b, reversing
changes made to 1dbafd8ba2.

The previous merge of work on #665 broke the build so this commit
reverts it back out.
2021-02-27 13:58:06 +00:00
Craig Fowler 8deb1a1f56 WIP #665 - Beginnings of SonarCloud integration
Adds an XUnit test logger to each test csproj
file (will be used by test script).

Also add a skeleton SonarCloud analysis config file with a couple
of settings for starters: Don't analyse exception classes or samples
for coverage.
2021-02-27 12:41:55 +00:00
Craig Fowler f34409696d
Should resolve #653 - Reinstate tests in CI process for v2 branch (#658)
* WIP #653 - Delete two tests

These two couldn't easily be fixed, in both cases they were
integration tests which involved passing through many classes.
It wasn't immediately clear what needed to be done to fix them.

As noted in the issue description, removing them was an
acceptable fix.

* WIP #653 - Fix a failing test

I split this test into two.  Per the discussion at:
  https://github.com/xunit/xunit/issues/350
XUnit seems quite opinonated about not having assertion messages.
Thus, without changing assertion library (which deserves discussion
before I just do it), the logical next best thing is to split into two
single-assert tests, so it's clear which assertion failed on a test
failure.

Also, I moved the AutoMoqData attribute to the shared test lib, so
that it can be used anywhere.  That allowed me to eliminate the
constructor for this test class, except for initialising the base class.

* Provisionally resolve #653 - reinstate tests in CI

This should complete the issue although we need to see a
passing CI build with this code change before we can say
it's done.

* Provisionally resolves #653 - Add test script
2021-02-25 09:24:00 +01:00
Craig Fowler b583c7f1a9
Resolves #485 - Add PurgeVariables functionality (#654)
* Trivial - Add VS Code workspace

* Trivial - Add VSCode build task & extra ignore

On GNU/Linux, auto-generated .directory
files should be ignored.

* WIP #485 - Boilerplate for unit test project

* WIP #485 - Add test coverage (Remove/RemoveAll)

* WIP #485 - Implement RemoveAll

* Remove redundant logic, covered by IDictionary

Per the following, the contract for a generic IDictionary,
the Remove method already deals with non-existent keys.

  https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.idictionary-2.remove?view=net-5.0#System_Collections_Generic_IDictionary_2_Remove__0_

* Resolve #485 - Add PurgeVariables methods

These are convenience methods upon ActivityExecutionContext
and WorkflowExecutionContext, consistent with their current APIs.

Also in this commit are tests for those simple methods.
There's a bit of test-scaffold as well included, such as:
* Autofixture Xunit2 integration
* New project for unit tests
* Customize attribute for avoiding crashes on Autofixture recursion
* Reusable specimen builder for creating IServiceProvider which
  resolves services from Autofixture
* Custonize attribute for a parameter to use that ^^ specimen builder
2021-02-24 14:29:03 +01:00
Sipke Schoorstra bd3b41440a Incremental work on tests and QA 2020-10-19 22:12:11 +02:00
Sipke Schoorstra 8423fde504 Incremental work on trigger API 2020-10-17 12:49:41 +02:00
Sipke Schoorstra bbf0cfa8f8 Fix solution build 2020-10-16 20:52:32 +02:00
Sipke Schoorstra d9d567a489 Incremental work on blueprints 2020-10-11 22:02:14 +02:00
Sipke Schoorstra 7a7d032e9e Remove unused namespaces 2020-10-11 14:33:56 +02:00
Sipke Schoorstra 7e45845a47 Introduce Workflow Instance Manager and Workflow Definition Manager 2020-10-11 14:33:18 +02:00
Sipke Schoorstra 1a85fc5f26 Implement in-memory provider 2020-10-10 21:10:09 +02:00
Sipke Schoorstra e1f5b6a8a5 Implement YesSql 2020-10-10 17:13:52 +02:00
Sipke Schoorstra 899f12e35f Cleanup and apply new field naming convention 2020-10-09 19:52:54 +02:00
Sipke Schoorstra a0a68679bc Implement activity property setters 2020-10-03 12:48:25 +02:00
Sipke Schoorstra a6977a6a43 Update packages 2020-08-21 09:25:45 +02:00
Sipke Schoorstra dd0e123828 Update packages 2020-04-19 15:39:28 +02:00
Sipke Schoorstra 60bfb4e7b2
Added Graphql (#246)
* Added GraphQL using Hot Chocolate
2020-02-15 20:32:16 +01:00
Sipke Schoorstra e7bf3f5ab6 Fix tests 2020-01-19 10:13:11 +01:00
Sipke Schoorstra 6a6edde7de Restored workflow persistence functionality 2020-01-18 13:11:11 +01:00
Sipke Schoorstra aefe630f42 Merge branch 'develop' into feature/elsa-2.0
# Conflicts:
#	Samples.sln
#	src/core/Elsa.Abstractions/Elsa.Abstractions.csproj
#	src/core/Elsa.Core/Elsa.Core.csproj
#	src/persistence/Elsa.Persistence.EntityFrameworkCore/Extensions/EFCoreServiceCollectionExtensions.cs
#	src/providers/Elsa.Persistence.EntityFrameworkCore/Elsa.Persistence.EntityFrameworkCore.csproj
#	src/providers/Elsa.Persistence.YesSql/DbContexts/DesignTimeDbContextFactoryBase.cs
#	src/providers/Elsa.Persistence.YesSql/DbContexts/MySqlContext.cs
#	src/providers/Elsa.Persistence.YesSql/DbContexts/MySqlContextFactory.cs
#	src/providers/Elsa.Persistence.YesSql/Elsa.Persistence.YesSql.csproj
#	src/providers/Elsa.Persistence.YesSql/Migrations/MySql/20200113102615_InitialCreate.Designer.cs
#	src/providers/Elsa.Persistence.YesSql/Migrations/MySql/20200113102615_InitialCreate.cs
#	src/providers/Elsa.Persistence.YesSql/Migrations/MySql/MySqlContextModelSnapshot.cs
#	src/samples/Elsa.Samples.Timers/Elsa.Samples.Timers.csproj
#	src/samples/Sample05/Program.cs
#	src/samples/Sample08/Sample08.csproj
#	src/samples/Sample08/Startup.cs
#	src/samples/Sample14/Program.cs
#	src/samples/Sample14/Sample14.csproj
#	src/samples/Sample16/Sample16.csproj
#	src/samples/Sample18/Program.cs
#	src/samples/Sample18/Sample18.csproj
#	src/samples/Sample19/Sample19.csproj
#	src/samples/Sample19/Startup.cs
#	src/samples/Sample21/Sample21.csproj
#	src/samples/Sample21/Startup.cs
#	src/samples/Sample22/Program.cs
#	src/samples/Sample22/Sample22.csproj
#	src/samples/Sample23/Program.cs
#	src/samples/Sample23/Sample23.csproj
2020-01-16 21:23:45 +01:00
Sipke Schoorstra 7b94637386
Code-first improvements (#223)
* Refactor workflow model and scheduler

* Improve workflow builder API
2020-01-12 20:15:57 +01:00
Sipke Schoorstra 8092d166a5
Add native .NET code support + activity input/output (#216)
* Add code activity

* Refactor Workflow State to use Variables

* Update InstantEvent and SetVariable

* Update samples

* Add activity input/output
2019-12-23 21:43:11 +01:00
Sipke Schoorstra bd422f5d14
Feature/persist on every activity (#215)
* Add support for resuming crashed workflow hosts
* Add workflow persistence behavior
2019-12-21 12:34:27 +01:00