NuGet development: new functional tests: packages

Topics: General
Jul 19, 2012 at 9:33 AM

I'm trying to create some new functionality in NuGet, and to facilitate that I want to create a new functional test.  I've added code in the test/EndToEnd folder (e.g. in tests/install.ps1), which works as I expected.  What I haven't been able to do is add my own custom test package.  How can I get this working?

To go into more detail about what I do know, I've created a new test called, say, Test-FTest, which creates a new project and tries to install jQuery into it.  To do this, I created a new folder in Packages called FTest, and copied jQuery.1.5.nuspec into it.  This works; the files get downloaded (from somewhere???) and installed into the test project.

Now, I've created a test package that just contains some content to install into my project, but I now don't know what to do with it to get it into the test.  Obviously just copying the .nuspec into Packages/FTest doesn't work -- in fact just doing that prevents the tests from running, and generates a whole load of exceptions, presumably on the "server"-side.  So where do I copy the .nupkg file?  Or is that completely wrong, and there's another way to do these tests?



Jul 19, 2012 at 4:47 PM might give you some insight on how the package creation tool works.

Unless absolutely necessary, we recommend against checking in binaries into the source tree going forward. You can, as you tried, check in the nuspec file in the FTest directory. Specify the files node and list out paths that you would want to exist in the package. The package generation tool would create and include 0-byte files at these locations. 

Jul 20, 2012 at 10:02 AM
Edited Jul 23, 2012 at 11:52 AM

Thanks, pranavkm -- I did read that page, but I somehow missed that section! I've got it working now as I wanted; I'm not quite sure why I was getting errors beforehand, but I think it was because I hadn't actually put a <files/> tag in the .nuspec file.