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

Check if template exists before download. #1019

Closed
sswaroopgupta opened this issue Apr 24, 2018 · 2 comments
Closed

Check if template exists before download. #1019

sswaroopgupta opened this issue Apr 24, 2018 · 2 comments

Comments

@sswaroopgupta
Copy link
Contributor

If there is an error to initialize project. Error downloading file: https://downloads.gauge.org/templates/<plugin>.zip.
404 Not Found - Refer build logs https://build.getgauge.io/go/tab/build/detail/Csharp-FT/1293/specs/1/linux

Failed Step: Initialize a project named "Data_Driven_execution" without example spec
        Specification: specs/advanced_topics/data_driven_execution/scenario_with_unused_table_values/SpecWithDataTableValues.spec:6
        Error Message: java.lang.Exception: Unable to initialize gauge project.
        STDERR:



        STDOUT:

        Downloading csharp.zip
        Error ----------------------------------

        Failed to initialize project. Error downloading file: https://downloads.gauge.org/templates/csharp.zip.
        404 Not Found

        Get Support ----------------------------
        	Docs:          https://docs.gauge.org
        	Bugs:          https://github.com/getgauge/gauge/issues
        	Chat:          https://gitter.im/getgauge/chat

        Your Environment Information -----------
        	linux, 0.9.8, 503b4c7
        	csharp (0.10.3), html-report (4.0.4), java (0.6.7), xml-report (0.2.1)

        Stacktrace: 
        com.thoughtworks.gauge.test.common.builders.ProjectBuilder.build(ProjectBuilder.java:27)
        com.thoughtworks.gauge.test.implementation.ProjectInit.projectInitWithoutHelloWorldSpec(ProjectInit.java:42)

It should be initialized with the offline template

This is applicable only to the basic template
example - gauge init csharp

This is a master issue. This can be done for all language plugins.

@sriv
Copy link
Member

sriv commented Apr 24, 2018

There is no csharp template. so this isn't an optimization.

gauge init csharp should always use the language runner for template generation.

in any case, if the internet is unavailable, gauge should fall back to the runner.

Any hints on how to replicate this?

sriv added a commit that referenced this issue Apr 24, 2018
sriv added a commit to getgauge/common that referenced this issue Apr 24, 2018
@sriv sriv added ready for QA and removed ready labels Apr 24, 2018
@sriv
Copy link
Member

sriv commented Apr 24, 2018

fix should be available in nightly >= 25/4/2018

gauge sends a HEAD request to check if requested template exists in the template repository, and on receiving a 404 it used to error out. Now gauge is a little more strict. only on explicitly receiving a 200 shall gauge attempt to download. This prevents false positives if the server sends a 5XX or 4XX response.

@ghost ghost removed the ready for QA label Apr 24, 2018
@nehashri nehashri changed the title [Optimization] Offline templates for basic init templates can reduce some flakiness in tests Check if template exists before download. May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants