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

feat(core): added support for test project name suffix #78

Merged
merged 1 commit into from
Aug 10, 2021

Conversation

photomoose
Copy link
Contributor

@photomoose photomoose commented Aug 10, 2021

As discussed in issue #77, this PR adds the ability to specify a suffix for test projects. Usage is as follows:

When creating a test project at the same time as an app, the following command creates a test project named some-app-unit-tests with the C# project/namespace named <workspace>.SomeApp.UnitTests:

nx generate @nx-dotnet/core:app --name=some-app --language=C# --template=console --testTemplate=xunit --testProjectNameSuffix=unit-tests

When creating a new test project for an existing app, the following command creates a test project named some-app-integration-tests with the C# project/namespace named <workspace>.SomeApp.IntegrationTests:

nx generate @nx-dotnet/core:test --name=some-app --language=C# --testTemplate=xunit --suffix=integration-tests

Note: tests have been added, but I notice some tests in generate-test-project.spec.ts were excluded as they fail due to apps being in sub-directories - not sure why. I've created similar tests for this new functionality, which also fail in the same way, and so they have also been excluded from the test run - I'll leave those with you to look at.

@nx-cloud
Copy link

nx-cloud bot commented Aug 10, 2021

Nx Cloud Report

CI ran the following commands for commit 7c6f422. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=e2e --all
#000000 nx run-many --all --target=build --with-deps
#000000 nx affected --target=lint --base=origin/master --parallel
#000000 nx affected --target=test --base=origin/master --parallel
#000000 nx affected --target=build --base=origin/master --parallel --with-deps

Sent with 💌 from NxCloud.

@sonarcloud
Copy link

sonarcloud bot commented Aug 10, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@AgentEnder
Copy link
Member

Hey @photomoose! Thanks for getting this put together, everything looks good 😄.

@AgentEnder
Copy link
Member

Hmmmm.... I am getting 500 errors right now trying to merge. Will try again in a bit.

@AgentEnder AgentEnder merged commit 9f8f03c into nx-dotnet:master Aug 10, 2021
@AgentEnder
Copy link
Member

@all-contributors please add @photomoose for code

github-actions bot pushed a commit that referenced this pull request Aug 10, 2021
# [1.1.0](v1.0.2...v1.1.0) (2021-08-10)

### Features

* **core:** added support for test project name suffix ([#78](#78)) ([9f8f03c](9f8f03c)), closes [#77](#77)

Aug 10, 2021, 4:29 PM
@github-actions
Copy link
Contributor

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@allcontributors
Copy link
Contributor

@AgentEnder

I've put up a pull request to add @photomoose! 🎉

@photomoose photomoose deleted the feat/multiple-test-projects branch August 10, 2021 16:33
@photomoose
Copy link
Contributor Author

Hey @photomoose! Thanks for getting this put together, everything looks good 😄.

No problem - just realised I haven't updated the docs; will try to do that tonight.

@AgentEnder
Copy link
Member

No worries, they are auto-generated during CI so the docs are accurate on the website. I need to add a prepush hook to check that the repo is up to date, so that people who look here see good info.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants