Comments (7)
This sounds awesome. I was thinking of something similar as well the other day but thought "oh that sounds like more work than I have time for now" :)
If you would provide a PR for that this would be fantastic. This is definitely the way to go.
from giraffe-template.
I have made some progress on the tests.
To see the progress check this ps1 file: https://github.com/dburriss/giraffe-template/blob/feature/template-tests/Test-Template.build.ps1
Currently it has the testing. I am going to add the paket.lock as a task. Might want to rename it. Maybe we could replace the build.ps1 file with this task runner although that does increase complexity slightly as it has a dependency on Invoke-Build.
Testing different permutations
from giraffe-template.
invoke-build Update-AllPaketLock
task added to https://github.com/dburriss/giraffe-template/blob/feature/template-tests/Test-Template.build.ps1
from giraffe-template.
@dustinmoris development is complete on the automation of tests and auto updating the paket.lock. Test-Template.build.ps1
is not really fitting when it contains the paket.lock updates.
I could split but then get into a ps1 explosion because there is some shared code so that would go in a 3rd ps1...
Thinking Template.build.ps1
the build part is a convention used by Invoke-Build.
from giraffe-template.
@dustinmoris Added some readme content but not sure it is in the correct place?
https://github.com/dburriss/giraffe-template/tree/feature/template-tests#contributing
from giraffe-template.
@dustinmoris What do you want to do about this?
https://github.com/dburriss/giraffe-template/tree/feature/template-tests#testing-template-generation
The tests run and test a few permutations...
#some defaults
@{File='Test-Template.build.ps1'; }
@{File='Test-Template.build.ps1'; IncludeTests=$true}
@{File='Test-Template.build.ps1'; UsePaket=$true}
@{File='Test-Template.build.ps1'; IncludeTests=$true; UsePaket=$true}
#Giraffe
@{File='Test-Template.build.ps1'; ViewEngine="Giraffe"; IncludeTests=$false; UsePaket=$false}
@{File='Test-Template.build.ps1'; ViewEngine="Giraffe"; IncludeTests=$true; UsePaket=$false}
@{File='Test-Template.build.ps1'; ViewEngine="Giraffe"; IncludeTests=$false; UsePaket=$true}
@{File='Test-Template.build.ps1'; ViewEngine="Giraffe"; IncludeTests=$true; UsePaket=$true}
#Razor
@{File='Test-Template.build.ps1'; ViewEngine="Razor"; IncludeTests=$false; UsePaket=$false}
@{File='Test-Template.build.ps1'; ViewEngine="Razor"; IncludeTests=$true; UsePaket=$false}
@{File='Test-Template.build.ps1'; ViewEngine="Razor"; IncludeTests=$false; UsePaket=$true}
@{File='Test-Template.build.ps1'; ViewEngine="Razor"; IncludeTests=$true; UsePaket=$true}
#DotLiquid
@{File='Test-Template.build.ps1'; ViewEngine="DotLiquid"; IncludeTests=$false; UsePaket=$false}
@{File='Test-Template.build.ps1'; ViewEngine="DotLiquid"; IncludeTests=$true; UsePaket=$false}
@{File='Test-Template.build.ps1'; ViewEngine="DotLiquid"; IncludeTests=$false; UsePaket=$true}
@{File='Test-Template.build.ps1'; ViewEngine="DotLiquid"; IncludeTests=$true; UsePaket=$true}
It requires the installation of that Invoke-Build if that is acceptable.
from giraffe-template.
Hi,
Thanks for the suggested work with Invoke-Build.
I have implemented a very simple version of the permutation tests for now, but I think it works actually really well.
At the end of the original build script, after the giraffe-tempalte.{version}.nupkg
has been created I first run the dotnet new giraffe --list
command to check if an older giraffe-template
is already installed. If yes then the script will uninstall it by running dotnet new -u giraffe-template
.
Afterwards the script will immediately install the newly build template again.
When installation is complete the script will proceed to create a new .temp
folder and then run the dotnet new
command for each individual permutation (simple loop).
When that has completed (might take a bit) then the script will iterate through all test project folders and simply execute the ./build.cmd
on Windows or ./build.sh
on Unix environments. This was the easiest way to a) test that the build scripts work and b) build all projects and run the unit tests with a single command.
At last the script will go through all Paket enabled projects and run the paket update Giraffe
command to update Giraffe and copy the updated paket.lock
file into the correct template folder.
This might not be the most fancy way of doing it, but it works fairly simple, has been working really nicely for me now when updating the giraffe-template
to Giraffe 1.1.0 and it also didn't require any new dependencies.
from giraffe-template.
Related Issues (20)
- Add UseDeveloperExceptionPage HOT 2
- Cannot create new project with .NET Core 2.1.4 HOT 3
- paket.bootstrapper.exe SSL/TLS error and workaround HOT 3
- *dotnet new giraffe* not working | dotnet -v = 2.1.104 HOT 1
- BUG: HTTP Error 502.5 - Process Failure w/ Giraffe Template: `dotnet publish` & `dotnet run` HOT 1
- build.sh in template should have LF line endings, not CRLF HOT 2
- Paket.exe and build.sh issues in issues in giraffe template 0.17.0 HOT 8
- Document that project called giraffe will cause the build to fail
- Paket files included when View engine set to `None`
- Fix scripts HOT 2
- Giraffe Template fails in post-build action to make scripts executable HOT 5
- build failed if project name contains '-' HOT 2
- Error "cycle detected" using default template HOT 8
- The giraffe-template breaks the "implicit" contract of dotnet new templates HOT 1
- Using template on .NET Core 3.x HOT 7
- FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json' HOT 2
- Use args in CreateDefaultBuilder
- `dotnet run` is completely quiet, does not show port HOT 1
- Mention that ASPNETCORE_ENVIRONMENT defaults to Production HOT 2
- Build file on solution template
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from giraffe-template.