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

Compilation problem does not report correctly when running in Teamcity (& likely other CIs) #5951

Closed
lilianaziolek opened this issue Jun 17, 2019 · 9 comments

Comments

@lilianaziolek
Copy link

Version

v2.8.1

Reproduction link

https://codesandbox.io/s/codesandbox-nuxt-hvv2n

Steps to reproduce

  1. Create a default nuxt project and create a broken component - for example importing non-existing component (or download linked CodeSandbox project)

  2. Run to check for expected behaviour
    yarn install && yarn build && echo "should not see this"
    You will get nuxt fatal error and "should not see this" will not be printed.

  3. You can run same project in Teamcity to see build would succeed and no logs printed, but easier is to simulate this by setting env variable, e.g.
    export BUILD_NUMBER=123

  4. Clean up the directory and run the same command as 2. Rather than seeing build errors and skipped last command, the build will return 0 and will not print that it failed.

What is expected ?

  1. Even in quiet mode, I would expect the build to print compilation errors
  2. Build should fail with result code > 0

What is actually happening?

build quietly fails and returns 0 ("should not see this" is printed)

Additional comments?

As a current workaround, setting quiet:false in build section in nuxt.config.js enforces the behaviour in Teamcity to be same as usual, i.e. reports issues correctly in logs and with error code.

This bug report is available on Nuxt community (#c9376)
@ghost ghost added the cmty:bug-report label Jun 17, 2019
@stale
Copy link

stale bot commented Jul 8, 2019

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

@stale stale bot added the stale label Jul 8, 2019
@lilianaziolek
Copy link
Author

This issue still occurs. To reiterate reproduce steps:

  1. Download the codesandbox content as ZIP.
  2. Simulate running in TeamCity: go to command line, export env variable (use set on windows)
export BUILD_NUMBER=123
  1. Run command to install dependencies, run build and check status:
yarn install && yarn build && echo "should not see this"

Build status returns 0 and no errors are reported, instead of failing as supposed to.

@stale stale bot removed the stale label Jul 9, 2019
@garrensweet
Copy link

This should not be a stale issue. More time was spent on this than should have been necessary to figure out quiet: false would actually return the error.

@stale
Copy link

stale bot commented Jul 31, 2019

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

@stale stale bot added the stale label Jul 31, 2019
@garrensweet
Copy link

BUMP. Reproduction is above. This is not a stale issue. The same issue still exists, nothing has changed. There needs to be one (or more) of the following in place:

  1. Notify the user that quiet: true is enabled, and that errors will return 0 which DOES NOT FAIL.
  2. set the default to quiet: false and notify the user that errors will cause failures.

Either one is sufficient.

This is still the same issue in edge.

@stale stale bot removed the stale label Jul 31, 2019
@lilianaziolek
Copy link
Author

Could someone from Nuxt team comment on this at least?
As far as I can see this is still present, meaning any Nuxt builds in CI environments are potentially unsafe. The fact that build does not report failure means that where there is automated deployment (commit -> CI build & test -> deploy), a broken app can be deployed as CI has no way of seeing that there was a breaking change. In fact this is exactly what happened to us.

There is a workaround, but it's not enabled by default. This issue needs to be fixed (IMO quiet should only impact verbosity of the logging, not build status reporting), or if that's too difficult/too low priority, at least the default could be changed so that CI works with default settings.

@manniL
Copy link
Member

manniL commented Aug 1, 2019

Thanks for reporting! #6075 should've fixed that.

@lilianaziolek
Copy link
Author

Ahhh, good news :) Thanks, didn't notice the other issue.

@manniL
Copy link
Member

manniL commented Aug 1, 2019

NP and sorry for the delay 👍

Closing here as it'll be fixed in the upcoming v2.9 (should be already present in nuxt-edge)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants