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

Offer more (some!) approaches for template testing? #3

Open
seancorfield opened this issue Aug 6, 2021 · 4 comments
Open

Offer more (some!) approaches for template testing? #3

seancorfield opened this issue Aug 6, 2021 · 4 comments
Assignees
Labels
analysis needed Needs more design time question Further information is requested

Comments

@seancorfield
Copy link
Owner

Dominic Monroe on Slack:

An approach to testing, even just a few basic utilities to spin up a repl of some kind and run some functions, testing that they don't explode would be great. Right now I have a bash script that generates a few variants of the project and then I manually check that they do sensible things (like that (dev) works, or that a server starts)

@seancorfield seancorfield added the question Further information is requested label Aug 6, 2021
@seancorfield seancorfield self-assigned this Aug 6, 2021
@SevereOverfl0w
Copy link

https://git.sr.ht/~severeoverfl0w/juxt-wedge/tree/master/item/test-template here's the script I use which generates multiple varieties. There's a bunch of things I would ideally test as I change things (e.g. after running (go) does an HTTP request to / work?).

I can appreciate that some of these might be out of scope for clj-new, but I expect they're also the most useful thing to test alongside a template. There're properties you want to have hold across a matrix of possible combinations of options.

@seancorfield
Copy link
Owner Author

Just so I understand, this is about some additional support for testing a new template as you are developing it specifically, rather than general project testing?

@SevereOverfl0w
Copy link

Yeah, I'd be interested in testing the template in some way. I suppose the tools I might need are:

  • A tool to generate a full matrix of all possible options
  • A way to run in the context of the generated projects, and run some kind of test suite in that context. Perhaps forking out a new JVM for each project and running a script that I provide that could do the testing itself.

@seancorfield seancorfield changed the title Offer more approaches to basic project testing? Offer more (some!) approaches for template testing? Aug 6, 2021
@SevereOverfl0w
Copy link

I ended up with fairly simple tests.

  1. Start JVM with pREPL
  2. Run a few commands in that pREPL & check they do what I expect
  3. Test the system actually came up (in this case by using etaoin to load a browser and take a picture)
  4. Shut it all down cleanly

It would be nice to encourage template developers to do 1/2/4 by having something for this in the default template template. I rolled my own tools for that, I'm not sure if there's a programmatic client around for pREPL though.

@seancorfield seancorfield added the analysis needed Needs more design time label Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analysis needed Needs more design time question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants