Project types #27545
akwodkiewicz
started this conversation in
General
Project types
#27545
Replies: 1 comment
-
Even one more discrepancy -- this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Current Behavior
Project types
I feel there is a big gaping hole when it comes to "project types" that needs to be addressed. My report is about several issues that I had over the last weeks, all related to project types.
Values discrepancy
nx show projects
'--type
argument expects:"app", "lib", "e2e"
.In the documentation and
project.json
schema, the projects however can have 2 types:"application"
or"library"
.E2E implicitness
I have a project named
e2e
that is defined to be of typeapplication
. I want this project to be returned bynx show projects --affected --type=app
, because my CI needs to build all Docker images for affected apps that will be later deployed/run. That means apps, but also "test projects" (including, but not limited to thee2e
project).The command does not return
e2e
on the list of projects. Why? Because there is an implicite2e
project type, that is overriding myprojectType: "application"
. It is not documented properly and I assume it's set based on either the "e2e" prefix or the suffix (or both?) in the project name. My workaround will naturally be to rename the project, but I have to do it only because of this implicit behaviour that is not documented anywhere. Why is thise2e
project type overriding myapplication
type? Why isn't there some kind of a warning? Why isn'te2e
a separate project type that I could set inside theproject.json
file?What is E2E
I have a big project with a big number of integration tests that I wanted to parallelize on CI. Since I do not use any plugins I decided to extract integration tests into multiple
my-project-int--domain-a
,my-project-int--domain-b
, ... projects manually, mimicking the convention used by the Atomizer feature. But I did not usee2e
in the name of the projects, because it would be misunderstood by the rest of the team, where they expect "e2e" to mean browser-based tests. I used "int" infix. Was this a good call? Am I now missing some out-of-the-box features provided by Nx just because the names of the projects do not contain "e2e"? Or maybe it's good they don't contain "e2e", because "e2e" is not meant to be for integration tests?Why is the
e2e
its own type and at the same time it's not explicit? Why is it that it's "e2e" and not "tests" or why "integration-tests" do not have their own category? The convention is not explained anywhere in the docs. "e2e" got their own part of documentation only because there is now a new feature called Atomizer, but it is actually not about the convention, but the feature itself. It's explained technically in the context of plugins that allow splitting e2e tests in the "Integrated approach". There is no info on why "e2e" projects are treated differently by Nx, which is especially surprising to teams using a package-based approach, with no test-oriented Nx plugins. There is no info what Nx actually means by e2e tests (are these always browser-based tests (Cypress/Playwright style), or do backend-only API tests count as well).Expected Behavior
Please provide some info on what
e2e
actually mean for Nx. This will help teams end long debates and misunderstandings related to naming conventions in the projects. This is extremely important when bringing Nx into an existing project.Please consider
e2e
or a newtest
-like explicit project type which can be used inproject.json
and is not overridden by any other implicit mechanism. This will help meeting the expectations of the CLI behaviour.Or consider not overriding explicitly set
projectType
s withe2e
if the name matches some naming pattern (what is this pattern, BTW?)GitHub Repo
No response
Steps to Reproduce
N/A
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions