Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new testing facilities. #125

Merged
merged 7 commits into from
Jan 16, 2019
Merged

Added new testing facilities. #125

merged 7 commits into from
Jan 16, 2019

Conversation

Hajto
Copy link
Contributor

@Hajto Hajto commented Dec 4, 2018

Added TestingConfigurablePipeline and modified test sink to place demands autoamtically when configured to do so.

…ands autoamtically when configured to do so.
@Hajto Hajto requested review from mat-hek and bblaszkow06 and removed request for bblaszkow06 December 5, 2018 13:01
.gitignore Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
lib/membrane/integration/testing_configurable_pipeline.ex Outdated Show resolved Hide resolved
lib/membrane/integration/testing_configurable_pipeline.ex Outdated Show resolved Hide resolved
lib/membrane/integration/testing_data_source.ex Outdated Show resolved Hide resolved
lib/membrane/integration/testing_data_source.ex Outdated Show resolved Hide resolved
lib/membrane/integration/testing_sink.ex Outdated Show resolved Hide resolved
lib/membrane/integration/testing_sink.ex Outdated Show resolved Hide resolved
@mat-hek
Copy link
Member

mat-hek commented Dec 6, 2018

Maybe before we merge this write some tests in some element (UDP?) using these utils to check if they work (I think writing tests for tests is a bit overkill as for now)

lib/membrane/integration/testing_configurable_pipeline.ex Outdated Show resolved Hide resolved
import ExUnit.Assertions, only: [assert_receive: 1]

quote do
assert_receive {Membrane.Integration.TestingConfigurable.Pipeline, unquote(pattern)},
Copy link
Member

Choose a reason for hiding this comment

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

There is no such module as Membrane.Integration.TestingConfigurable.Pipeline but there is Membrane.Integration.TestingConfigurablePipeline. A dot makes the difference.

import ExUnit.Assertions, only: [assert_receive: 1]

quote do
assert_receive {Membrane.Integration.TestingConfigurable.Pipeline, unquote(pattern)},
Copy link
Member

Choose a reason for hiding this comment

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

As for the name itself, I really hate the current naming, it reminds me of Java and that's not a good thing. I would remove Integration instead and go for something like Membrane.Testing.ConfigurablePipeline or with Test instead of Testing @mat-hek

lib/membrane/integration/testing_data_source.ex Outdated Show resolved Hide resolved
import ExUnit.Assertions, only: [assert_receive: 1]

quote do
assert_receive {Membrane.Integration.TestingConfigurable.Pipeline, unquote(pattern)},
Copy link
Member

Choose a reason for hiding this comment

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

And one more: why ConfigurablePipeline? Is there a non-cofigurable version available for users? This one should be called TestingPipeline to be consistent with elemets in that module. Of course, that would mean the TestingPipeline from support should be renamed, but it will be now test-specific and I would rename it to sth like Membrane.DemandTest.(Testing)Pipeline

@Hajto
Copy link
Contributor Author

Hajto commented Dec 7, 2018

@mat-hek

Maybe before we merge this write some tests in some element (UDP?) using these utils to check if they work (I think writing tests for tests is a bit overkill as for now)

These elements are based on what I wrote for UDP element

@Hajto Hajto force-pushed the testing-tools branch 3 times, most recently from 36993c3 to ac67869 Compare December 11, 2018 08:17
@bblaszkow06 bblaszkow06 removed their request for review December 12, 2018 11:00
@bblaszkow06
Copy link
Member

Fix the build first https://travis-ci.com/membraneframework/membrane-core/builds/94304322

lib/membrane/testing/sink.ex Outdated Show resolved Hide resolved
lib/membrane/testing/source.ex Outdated Show resolved Hide resolved
lib/membrane/testing/pipeline.ex Outdated Show resolved Hide resolved
monitored_callbacks: pipeline_callback(),
test_process: pid(),
elements: Spec.children_spec_t(),
links: Spec.links_spec_t()
Copy link
Member

Choose a reason for hiding this comment

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

Not enforced keys can be nil as well

Structure representing `options` passed to testing pipeline.

## Monitored Callbacks
List of callback names that shall be sent to process in `test_process` field
Copy link
Member

Choose a reason for hiding this comment

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

This sentence does not actually explain what it does. Process test_process gets notified about the invocation of the callbacks passed here. Now description suggests the list will be sent at some point

lib/membrane/testing/pipeline/assertions.ex Outdated Show resolved Hide resolved
lib/membrane/testing/sink.ex Outdated Show resolved Hide resolved
lib/membrane/testing/data_source.ex Outdated Show resolved Hide resolved
lib/membrane/testing/pipeline.ex Outdated Show resolved Hide resolved
lib/membrane/testing/pipeline.ex Outdated Show resolved Hide resolved
lib/membrane/testing/pipeline.ex Outdated Show resolved Hide resolved
lib/membrane/testing/pipeline.ex Outdated Show resolved Hide resolved
lib/membrane/caps/matcher.ex Outdated Show resolved Hide resolved
lib/membrane/testing/source.ex Outdated Show resolved Hide resolved
lib/membrane/testing/pipeline.ex Show resolved Hide resolved
- Fixed few typos in existing documentation
@Hajto Hajto requested a review from mat-hek December 27, 2018 15:00
test/support/demand_test/filter.ex Outdated Show resolved Hide resolved
test/support/demand_test/pipeline.ex Outdated Show resolved Hide resolved
test/membrane/demands_test.exs Show resolved Hide resolved
lib/membrane/testing/pipeline.ex Outdated Show resolved Hide resolved
@Hajto Hajto requested a review from mat-hek January 7, 2019 12:36
Copy link
Member

@mat-hek mat-hek left a comment

Choose a reason for hiding this comment

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

See unresolved comments from the previous review. Resolve conflicts

@mat-hek mat-hek merged commit 4c886c4 into master Jan 16, 2019
@bblaszkow06 bblaszkow06 deleted the testing-tools branch February 15, 2019 10:04
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.

3 participants