Sha256: aa4845256f62846ea88a8dab47645049cf843deadf11997801c09cc8cf06b0df

Contents?: true

Size: 1.7 KB

Versions: 18

Compression:

Stored size: 1.7 KB

Contents

= How to test Decidim engines

== Requirements

You need to create a dummy application to run your tests. Run the following command in the decidim root's folder:

[source,bash]
----
bundle exec rake test_app
----

== Running a specific test file or just a single spec

If you are writing new specs, you can run the tests contained in a single file by opening a console window in the corresponding module and calling ``rspec``on the file. For example:

[source,bash]
----
cd decidim-participatory_processes
bundle exec rspec spec/forms/participatory_process_form_spec.rb
----

You can also run a single test by appending its start line number to the command:

[source,bash]
----
bundle exec rspec spec/forms/participatory_process_form_spec.rb:134
----

== Running tests for a specific component

A Decidim engine can be tested running the rake task named after it. For
example, to test the proposals engine, you can run:

[source,bash]
----
bundle exec rake test_proposals
----

== Running the whole test suite

You can also run the full thing including test application generation and tests
for all components by running

[source,bash]
----
bundle exec rake test_all
----

But beware, it takes a long time... :)

== Continuous integration

The tests are also run when a new commit is added to the `develop` or releases
branches, or added to a Pull Request. In the latter case, only the tests for
the modules affected by any the PR commits will be executed.

This means that the workflows defined for each module in the folder
`.github/workflows/` should be always updated with the module's dependencies
list. The script `.github/workflows/dependencies.sh` can be helpful to keep
those files updated until we have an automatic process to do it.

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
decidim-0.26.10 docs/modules/develop/pages/testing.adoc
decidim-0.26.9 docs/modules/develop/pages/testing.adoc
decidim-0.26.8 docs/modules/develop/pages/testing.adoc
decidim-0.26.7 docs/modules/develop/pages/testing.adoc
decidim-0.26.5 docs/modules/develop/pages/testing.adoc
decidim-0.26.4 docs/modules/develop/pages/testing.adoc
decidim-0.26.3 docs/modules/develop/pages/testing.adoc
decidim-0.26.2 docs/modules/develop/pages/testing.adoc
decidim-0.26.1 docs/modules/develop/pages/testing.adoc
decidim-0.26.0 docs/modules/develop/pages/testing.adoc
decidim-0.26.0.rc2 docs/modules/develop/pages/testing.adoc
decidim-0.25.2 docs/modules/develop/pages/testing.adoc
decidim-0.25.1 docs/modules/develop/pages/testing.adoc
decidim-0.25.0 docs/modules/develop/pages/testing.adoc
decidim-0.25.0.rc4 docs/modules/develop/pages/testing.adoc
decidim-0.25.0.rc3 docs/modules/develop/pages/testing.adoc
decidim-0.25.0.rc2 docs/modules/develop/pages/testing.adoc
decidim-0.25.0.rc1 docs/modules/develop/pages/testing.adoc