Comments (4)
I've thought about this a bit today and I believe both #25 and #26 can be accomplished with the addition of a get_enqueued/1
function. Within tests you would use it like this:
# Make an assertion that there is a single job with the args `%{id: 1}`
assert [%{args: %{id: 1}}] = get_enqueued(worker: MyWorker, queue: "foobar")
# Make an assertion that there is exactly one matching job
assert [%Oban.Job{}] = get_enqueued(worker: MyWorker, queue: "foobar")
This is flexible and allows you to make any assertions that you like in your tests.
from oban.
That sounds very fine
from oban.
Thanks for the suggestion. Between the pattern matching suggestion here and in #25 I believe it is possible to write more robust (though verbose) tests when necessary.
Please take a look at 3c5ed47 and let me know if it works for you.
from oban.
Thanks, this is perfect. I've already tested it, and it works great.
from oban.
Related Issues (20)
- allow phoenix_html 4.0 in oban_web HOT 1
- Selecting jobs in Oban Web UI throws exception HOT 8
- Behaviour check in config validation fails with non-standard Repo module HOT 3
- Introduce global timeouts for workflows HOT 2
- Queue allowlist/denylist support for Lifeline Plugin HOT 1
- Oban Pro v1.3.1 Workflows jobs not moving to executing state HOT 16
- Oban with postgres fails when elixir time_zone_database is set to Tzdata.TimeZoneDatabase HOT 1
- Oban.Pro.Workers.Batch not executing callbacks when there is only one job in the batch HOT 1
- Potentially bug in handling DB errors in `Oban.Peers.Postgres` HOT 2
- Seeing High CPU Usage with Oban Table Partitioned HOT 12
- Overriding Worker.new results in a compilation warning HOT 2
- Oban Pro: jobs get stuck in executing and become orphans HOT 20
- Structs cannot be passed to Job.new HOT 3
- Notifier logs after upgrading to 2.17.4 HOT 18
- Upgrading to Oban 2.17.4 from 2.17.3 fails compilation step with `no function clause matching in Ecto.Query.with_cte/3 ` HOT 1
- Oban 2.17.4 update MATERIALIZED syntax error HOT 3
- Oban Web is refreshing the page constantly HOT 1
- Unclear docs for `perform/1` callback in case of an unhandled exception, exit or throw HOT 1
- Crontab information in Oban jobs (or job-related Telemetry events) HOT 7
- Potential bug: available jobs not being run HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oban.