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

Print errors that arise when parsing the manifest #1125

Merged
merged 5 commits into from
Mar 31, 2020
Merged

Conversation

pepicrft
Copy link
Contributor

Fixes #1120

Short description 📝

This PR fixes the issue reported by @kwridan here. I changed the logic in the ManifestLoader class to use the new observable APIs and print all the events that are sent through the standard error.

Moreover, I changed the way tuistenv passes the environment variable by setting it to the environment dictionary instead (look at the CommandRunner.swift) class.

@pepicrft pepicrft self-assigned this Mar 18, 2020
@pepicrft pepicrft requested a review from kwridan March 18, 2020 12:07
@pepicrft
Copy link
Contributor Author

@kwridan while debugging this issue I noticed that when tuistenv is run from Xcode or using swift run tuistenv, it reads the binary from the global ~/.tuist/directory, instead of the one under .build/debug. I'll open a follow-up PR changing that behavior.

@codecov
Copy link

codecov bot commented Mar 18, 2020

Codecov Report

Merging #1125 into master will increase coverage by 0.13%.
The diff coverage is 68.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1125      +/-   ##
==========================================
+ Coverage   77.11%   77.24%   +0.13%     
==========================================
  Files         270      269       -1     
  Lines        9429     9484      +55     
==========================================
+ Hits         7271     7326      +55     
  Misses       2158     2158              
Impacted Files Coverage Δ
Sources/ProjectDescription/Up/UpCarthage.swift 0.00% <0.00%> (ø)
Sources/ProjectDescription/Up/UpCustom.swift 0.00% <0.00%> (ø)
Sources/ProjectDescription/Up/UpHomebrew.swift 0.00% <0.00%> (ø)
Sources/ProjectDescription/Up/UpHomebrewTap.swift 0.00% <0.00%> (ø)
Sources/TuistCore/Models/Config.swift 60.00% <ø> (ø)
...TuistGenerator/Generator/BuildPhaseGenerator.swift 97.74% <ø> (ø)
...ces/TuistGenerator/Generator/ConfigGenerator.swift 94.44% <ø> (-3.48%) ⬇️
Sources/TuistGenerator/Generator/Generator.swift 0.00% <0.00%> (ø)
...s/TuistKit/ProjectGenerator/ProjectGenerator.swift 16.90% <0.00%> (ø)
...rces/TuistScaffold/TemplatesDirectoryLocator.swift 27.27% <0.00%> (ø)
... and 56 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce75b4f...e60091d. Read the comment docs.

Copy link
Collaborator

@kwridan kwridan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for looking into this @pepibumur

Copy link
Collaborator

@ollieatkinson ollieatkinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran this locally and it appears the issue @kwridan found is still present:

~/Development/Tuist/fixtures/ios_app_with_tests [print-errors !?] $ swift run tuist generate
/Users/oliver/Development/Tuist/fixtures/ios_app_with_tests/Project.swift:14:91: error: expected ',' separator
                                                           "CODE_SIGNING_REQUIRED": "NO"])),
                       
Unexpected output trying to parse the manifest at path /Users/oliver/Development/Tuist/fixtures/ios_app_with_tests/Project.swift

~/Development/Tuist/fixtures/ios_app_with_tests [print-errors !?] $ swift run tuist generate
/Users/oliver/Development/Tuist/fixtures/ios_app_with_tests/Project.swift:14
Unexpected output trying to parse the manifest at path /Users/oliver/Development/Tuist/fixtures/ios_app_with_tests/Project.swift

Notice the second run has trimmed the error

@pepicrft pepicrft force-pushed the print-errors branch 2 times, most recently from e8a50cf to 2433250 Compare March 30, 2020 16:55
@pepicrft
Copy link
Contributor Author

@ollieatkinson would you mind trying again with the latest commits? I can't reproduce the issue anymore.

Copy link
Collaborator

@ollieatkinson ollieatkinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to run this several times and the output was consistent 👍

@pepicrft
Copy link
Contributor Author

I added an acceptance test to detect regressions here.

@pepicrft pepicrft merged commit 2bd3904 into master Mar 31, 2020
@natanrolnik natanrolnik deleted the print-errors branch June 17, 2020 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manifest errors are no longer getting reported
3 participants