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

Add currentScript property to interface Document #12

Closed
wants to merge 4 commits into from
Closed

Add currentScript property to interface Document #12

wants to merge 4 commits into from

Conversation

emilgpa
Copy link
Contributor

@emilgpa emilgpa commented Nov 5, 2015

@zhengbli
Copy link
Contributor

zhengbli commented Nov 5, 2015

@DasHaus Hello! As the dom.generated.d.ts is auto generated by a script, to update it you need to make several changes to make the test pass:

  1. Add the missing element to inputfiles/addedTypes.json, or overriding element to inputfiles/overridingTypes.json, or elements to remove to inputfiles/removedTypes.json
  2. Run the script locally to obtain new dom.generated.d.ts and webworker.generated.d.ts
  3. Update the baselines in the baselines folder using the newly generated files

Then the CI will first check if the generated files match the baselines, and then if all compiler tests pass using the newly generated files.

@zhengbli
Copy link
Contributor

zhengbli commented Nov 5, 2015

Aha you are already doing it. Kudos! I'll just keep the comment for future references.

@emilgpa
Copy link
Contributor Author

emilgpa commented Nov 5, 2015

Thanks you! And I'm Sorry, I'm a newbie at this... The test fails, but I did not follow instructions correctly... I have a question: The script is possible execute it from OS X? I use this OS so I don't know if it is possible...

@zhengbli
Copy link
Contributor

zhengbli commented Nov 5, 2015

No worries! I just found the CI server has some problems too.
And It is possible to build on OSX. Let me try adding support for OS X build tonight get get back to you.

@emilgpa
Copy link
Contributor Author

emilgpa commented Nov 5, 2015

Ok, nice! Thanks you!

@zhengbli
Copy link
Contributor

zhengbli commented Nov 5, 2015

@DasHaus OK now it should be done. Although to run the script you need to install mono 4.2 from:
http://www.mono-project.com/download/alpha/

And then you can just run ./build.sh

@zhengbli
Copy link
Contributor

zhengbli commented Nov 5, 2015

Although I think in this case the reason why generated script is different from the baseline is the added comment. You can either change the inputfiles/comment.json as well, or just not adding comment.

@emilgpa
Copy link
Contributor Author

emilgpa commented Nov 5, 2015

Ok, I deleted the comment, but I go to use the script for add the comment in comment.json

@emilgpa
Copy link
Contributor Author

emilgpa commented Nov 5, 2015

The test fails so I go to try do it following the instructions!

@emilgpa
Copy link
Contributor Author

emilgpa commented Nov 5, 2015

I clone the repo, I add to the end of file in addedTypes.json the below code:

{
        "link": "property",
        "interface": "Document",
        "name": "currentScript",
        "type": "HTMLScriptElement"
}

Finally, run ./build.sh and the test is ok:

No version specified. Downloading latest stable.
Paket.exe 2.22.2 is up to date.
Paket version 2.22.2.0
0 seconds - ready.
Building project with version: LocalBuild
Shortened DependencyGraph for Target Test:
<== Test
   <== Run

The resulting target order is:
 - Run
 - Test
Starting Target: Run 
Finished Target: Run
Starting Target: Test (==> Run)
All tests passed.
Finished Target: Test

---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target     Duration
------     --------
Run        00:00:05.9778622
Test       00:00:00.0285978
Total:     00:00:06.0578896
Status:    Ok
---------------------------------------------------------------------

But the dom.generated.d.ts file from generated folder is exactly equal than the baselines file.

Are I doing something wrong?

@zhengbli
Copy link
Contributor

zhengbli commented Nov 5, 2015

@DasHaus in the Json file it should be "kind" instead of "link" I think

@emilgpa
Copy link
Contributor Author

emilgpa commented Nov 5, 2015

Ajam! Now the test fails but the file generated include the currentScript...

Is It because the generated file is different to same file of baselines folder, right?

Building project with version: LocalBuild
Shortened DependencyGraph for Target Test:
<== Test
   <== Run

The resulting target order is:
 - Run
 - Test
Starting Target: Run 
Finished Target: Run
Starting Target: Test (==> Run)
Running build failed.
Error:
System.Exception: 
Test failed: dom.generated.d.ts is different from baseline file.
   at FSI_0001.Build+clo@24-1.Invoke (Microsoft.FSharp.Core.Unit _arg1) in <filename unknown>:line 0
   at Fake.TargetHelper+targetFromTemplate@195[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) in <filename unknown>:line 0
   at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) in <filename unknown>:line 0

---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target     Duration
------     --------
Run        00:00:05.9406188
Total:     00:00:06.0263224
Status:    Failure
---------------------------------------------------------------------
  1) System.Exception: 
Test failed: dom.generated.d.ts is different from baseline file.
   at FSI_0001.Build+clo@24-1.Invoke (Microsoft.FSharp.Core.Unit _arg1) in <filename unknown>:line 0
   at Fake.TargetHelper+targetFromTemplate@195[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) in <filename unknown>:line 0
   at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) in <filename unknown>:line 0
---------------------------------------------------------------------

@zhengbli
Copy link
Contributor

zhengbli commented Nov 5, 2015

Right, from the error message: Test failed: dom.generated.d.ts is different from baseline file. :)
So do you still see the tests fail if you update the baseline files accordingly?

@emilgpa
Copy link
Contributor Author

emilgpa commented Nov 5, 2015

Ok, I copy the generated file to baselines folder and the tests is ok, but including the comment in comments.json does not effect... it is not included in the generated file.

@zhengbli
Copy link
Contributor

zhengbli commented Nov 5, 2015

@DasHaus My bad that the comment now is not picked up. Though you can just send PR without the comments. I'll add the part later.

@emilgpa emilgpa closed this Nov 6, 2015
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.

2 participants