Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10215] Tooling: SDK build should fail outright if JSCA file creation has a runtime error

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-08-22T11:13:26.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sSprint 2012-16 Core, Release 3.0.0
ComponentsTooling
Labelscore, qe-port
ReporterBill Dawson
AssigneeBill Dawson
Created2012-07-27T14:12:26.000+0000
Updated2012-12-08T00:52:35.000+0000

Description

A runtime error can occur during JSCA file creation (a late step in the SDK build process) and yet not stop the build. This means that the SDK can then be packaged (zipped up) with a faulty .jsca file, which of course should not be allowed. Instead, if the JSCA file creation process contains an error, the build should fail hard.

Fail case / test case

1. Open apidoc/Titanium/Titanium.yml in a text editor. 2. Put a space before "name: Titanium" (i.e, put a space at the beginning of that line.) Of course that space does not belong there, but we're breaking the file on purpose. 3. Save the file. 4. Run python apidoc/docgen.py -f jsca. You'll see a runtime error fly by. This is just proof that there is something wrong with the JSCA file creation. 5. Run scons. One of the last steps of the scons process will be "Generating JSCA...". 6. In the fail case, the build will still say it succeeded, and the zip file will be packaged as if nothing happened. 7. When testing the fix, the build *should fail* since an error is occurring (though not visible) during the JSCA file creation. 8. Check in dist/ folder when the build fails: the relevant zip(s) should not be there.

Comments

  1. Bill Dawson 2012-08-07

    PR ready: https://github.com/appcelerator/titanium_mobile/pull/2688
  2. Bill Dawson 2012-08-09

    2_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/2707
  3. Bill Dawson 2012-08-10

    Shoulda been closed when 2_1_X PR went in.
  4. Olga Romero 2012-08-20

    Tested with 2_1_X An -osx.zip still being created.
  5. Olga Romero 2012-08-20

    Here is the log: BUILD SUCCESSFUL Total time: 8 minutes 14 seconds scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... package_sdk(["dummy-sdk-target"], []) Packaging MobileSDK (2.1.2)... Generating JSCA... /usr/bin/python /Users/oromero/fromgit/titanium_mobile/apidoc/docgen.py -f jsca --stdout Failed to generate JSCA JSON. Output: [INFO] Parsing YAML files [ERROR] Exception occurred while processing /Users/oromero/fromgit/titanium_mobile/apidoc/Titanium/Titanium.yml: Traceback (most recent call last): File "/Users/oromero/fromgit/titanium_mobile/apidoc/docgen.py", line 614, in main() File "/Users/oromero/fromgit/titanium_mobile/apidoc/docgen.py", line 606, in main process_yaml() File "/Users/oromero/fromgit/titanium_mobile/apidoc/docgen.py", line 189, in process_yaml types = load_one_yaml(filepath) File "/Users/oromero/fromgit/titanium_mobile/apidoc/docgen.py", line 150, in load_one_yaml types = [the_type for the_type in yaml.load_all(f)] File "build/bdist.macosx-10.8-intel/egg/yaml/__init__.py", line 82, in load_all File "build/bdist.macosx-10.8-intel/egg/yaml/constructor.py", line 28, in check_data File "build/bdist.macosx-10.8-intel/egg/yaml/composer.py", line 18, in check_node File "build/bdist.macosx-10.8-intel/egg/yaml/parser.py", line 98, in check_event File "build/bdist.macosx-10.8-intel/egg/yaml/parser.py", line 174, in parse_document_start yaml.parser.ParserError: expected '', but found '' in "/Users/oromero/fromgit/titanium_mobile/apidoc/Titanium/Titanium.yml", line 3, column 1 scons: *** [dummy-sdk-target] Explicit exit, status 1 scons: building terminated because of errors.
  6. Bill Dawson 2012-08-20

    It's not relevant if a partial .zip is there. The important thing is the build stopped running with an error. (You can compare it to older versions.) I've added a line to the instructions (very bottom) to reinforce it, however.
  7. Bill Dawson 2012-08-20

    Actually, ignore me. I don't trust that our jenkins scripts will respect the exit code, so I'm going to change this to forcibly delete the zip. Standby.
  8. Bill Dawson 2012-08-20

    Follow-up PR is ready: https://github.com/appcelerator/titanium_mobile/pull/2783 Someone from Platform Engineering will likely be assigned this tomorrow, then after that (assuming it gets merged) QE can take their new look as well.
  9. Olga Romero 2012-12-08

    Closing as fixed. Tested with: Titanium Studio, build: 3.0.0.201211301903 Titanium SDK, build 3.0.0.v20121207103200 Thanks Bill

JSON Source