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

Full test coverage and API documentation #34

Merged
merged 27 commits into from
Sep 17, 2013
Merged

Conversation

benlangfeld
Copy link
Member

WIP

This was referenced Sep 17, 2013
@benlangfeld
Copy link
Member Author

Going to trim the scope of this to just test coverage and API docs. I want to get that merged ASAP.

@benlangfeld benlangfeld mentioned this pull request Sep 17, 2013
@bklang
Copy link
Member

bklang commented Sep 17, 2013

Scenario #compile should be renamed #export and take a path at this point

What's the rationale behind this? I think of it as compiling because of the way we have to generate the PCAP to match the XML. But it's really just a language issue. I don't feel strongly about it, but I'm biased against changing it arbitrarily.

Overhaul CLI

I think this refers to making it so you can do sippy_cup run foo vs. sippy_cup -r foo.yml. I'm fine with this change, though I need to understand how you would do both commands in a single execution. There are valid reasons why you might want to compile-only, run-only, or compile-and-run together.

@benlangfeld
Copy link
Member Author

Compiling some PCAP audio and dumping the audio/scenario to disk are two separate concerns. Media#compile is fine, but the purpose of the method on Scenario is to export the scenario and all its components to disk.

As for compile-and-run, executing a scenario would use a temporary location on disk, vs exporting to a permanent location specified by a path. You would never need to do both in one command because the two are separate and independent.

@bklang
Copy link
Member

bklang commented Sep 17, 2013

Compiling some PCAP audio and dumping the audio/scenario to disk are two separate concerns. Media#compile is fine, but the purpose of the method on Scenario is to export the scenario and all its components to disk.

But "compiling" for the Scenario also refers to taking the steps and outputting generated XML. To me, compiling is the more appropriate verb for both of those things than exporting.

@bklang
Copy link
Member

bklang commented Sep 17, 2013

As for compile-and-run, executing a scenario would use a temporary location on disk, vs exporting to a permanent location specified by a path. You would never need to do both in one command because the two are separate and independent.

One of the use-cases I had envisioned was using sippy_cup to compile a scenario, then hand-edit the scenario, then use sippy_cup to run the now-edited scenario. In an ideal world you would never need to do this, but I think that we are not perfect yet in our capabilities. This would also allow you to run a compiled (and possibly edited) scenario repeatedly without needing to recompile the scenario each time.

👍 as far as using temporary files for running the scenarios if the compiled form is not explicitly requested.

@benlangfeld
Copy link
Member Author

Any chance of a quick review please, @bklang?

# Scenario.from_manifest(manifest, source: '192.168.12.1')
#
def self.from_manifest(manifest, options = {})
args = ActiveSupport::HashWithIndifferentAccess.new(Psych.safe_load(manifest)).symbolize_keys.merge options
Copy link
Member

Choose a reason for hiding this comment

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

Isn't #symbolize_keys redundant with HashWithIndifferentAccess?

Copy link
Member Author

Choose a reason for hiding this comment

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

Turns out no, but I havn't had time to dig into it.

@bklang
Copy link
Member

bklang commented Sep 17, 2013

👍 Looks good, thanks for the cleanup

benlangfeld added a commit that referenced this pull request Sep 17, 2013
Full test coverage and API documentation
@benlangfeld benlangfeld merged commit 43e356e into master Sep 17, 2013
@benlangfeld benlangfeld deleted the feature/new_api branch September 17, 2013 18:42
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.

2 participants