Skip to content

Changed request method from protected to public #7603

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

Merged
merged 2 commits into from
Oct 25, 2020

Conversation

rainerCH
Copy link
Contributor

@rainerCH rainerCH commented Oct 5, 2020

See #7563

@wing328
Copy link
Member

wing328 commented Oct 6, 2020

Update samples via bed12e1. Let's see if that fixes the CI issue.

cc PHP technical committees

@jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) ❤️, @ybelenko (2018/07), @renepardon (2018/12)

@ybelenko
Copy link
Contributor

ybelenko commented Oct 6, 2020

In samples/client/petstore/php/OpenAPIClient-php:

$  vendor/bin/phpunit tests
PHPUnit 9.3.11 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

EEEEE.........ES.................................ESSSSSSSSSSSSSS. 65 / 73 ( 89%)
......E.                                                          73 / 73 (100%)

Time: 00:10.231, Memory: 12.00 MB

There were 8 errors:

1) OpenAPI\Client\AsyncTest::testAsyncRequest
OpenAPI\Client\ApiException: [405] Client error: `POST http://petstore.swagger.io/v2/pet` resulted in a `405 Method Not Allowed` response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiResponse><type>unknown</type></apiResponse>


/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:162
/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:135
/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/AsyncTest.php:40

2) OpenAPI\Client\AsyncTest::testAsyncRequestWithHttpInfo
OpenAPI\Client\ApiException: [405] Client error: `POST http://petstore.swagger.io/v2/pet` resulted in a `405 Method Not Allowed` response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiResponse><type>unknown</type></apiResponse>


/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:162
/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:135
/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/AsyncTest.php:40

3) OpenAPI\Client\AsyncTest::testAsyncThrowingException
OpenAPI\Client\ApiException: [405] Client error: `POST http://petstore.swagger.io/v2/pet` resulted in a `405 Method Not Allowed` response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiResponse><type>unknown</type></apiResponse>


/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:162
/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:135
/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/AsyncTest.php:40

4) OpenAPI\Client\AsyncTest::testAsyncApiExceptionWithoutWaitIsNotThrown
OpenAPI\Client\ApiException: [405] Client error: `POST http://petstore.swagger.io/v2/pet` resulted in a `405 Method Not Allowed` response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiResponse><type>unknown</type></apiResponse>


/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:162
/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:135
/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/AsyncTest.php:40

5) OpenAPI\Client\AsyncTest::testAsyncHttpInfoThrowingException
OpenAPI\Client\ApiException: [405] Client error: `POST http://petstore.swagger.io/v2/pet` resulted in a `405 Method Not Allowed` response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiResponse><type>unknown</type></apiResponse>


/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:162
/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:135
/Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/AsyncTest.php:40

6) OpenAPI\Client\DebugTest::testEnableDebugOutput
OpenAPI\Client\ApiException: [405] Client error: `POST http://petstore.swagger.io/v2/pet` resulted in a `405 Method Not Allowed` response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiResponse><type>unknown</type></apiResponse>
 in /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:162
Stack trace:
#0 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php(15): OpenAPI\Client\Api\PetApi->addPetWithHttpInfo(Object(OpenAPI\Client\Model\Pet))
#1 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Framework/TestSuite.php(610): OpenAPI\Client\DebugTest::setUpBeforeClass()
#2 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Framework/TestSuite.php(665): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#3 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(671): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#4 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/Command.php(148): PHPUnit\TextUI\TestRunner->run(Object(PHPUnit\Framework\TestSuite), Array, Array, true)
#5 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/Command.php(101): PHPUnit\TextUI\Command->run(Array, true)
#6 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#7 {main}
7) OpenAPI\Client\PetApiTest::testGetPetById
OpenAPI\Client\ApiException: [405] Client error: `POST http://petstore.swagger.io/v2/pet` resulted in a `405 Method Not Allowed` response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiResponse><type>unknown</type></apiResponse>
 in /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:162
Stack trace:
#0 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php(49): OpenAPI\Client\Api\PetApi->addPetWithHttpInfo(Object(OpenAPI\Client\Model\Pet))
#1 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Framework/TestSuite.php(610): OpenAPI\Client\PetApiTest::setUpBeforeClass()
#2 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Framework/TestSuite.php(665): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#3 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(671): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#4 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/Command.php(148): PHPUnit\TextUI\TestRunner->run(Object(PHPUnit\Framework\TestSuite), Array, Array, true)
#5 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/Command.php(101): PHPUnit\TextUI\Command->run(Array, true)
#6 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#7 {main}
8) OpenAPI\Client\StoreApiTest::testGetInventory
OpenAPI\Client\ApiException: [405] Client error: `POST http://petstore.swagger.io/v2/pet` resulted in a `405 Method Not Allowed` response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiResponse><type>unknown</type></apiResponse>
 in /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php:162
Stack trace:
#0 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php(135): OpenAPI\Client\Api\PetApi->addPetWithHttpInfo(Object(OpenAPI\Client\Model\Pet))
#1 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/StoreApiTest.php(47): OpenAPI\Client\Api\PetApi->addPet(Object(OpenAPI\Client\Model\Pet))
#2 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Framework/TestSuite.php(610): OpenAPI\Client\StoreApiTest::setUpBeforeClass()
#3 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Framework/TestSuite.php(665): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#4 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(671): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#5 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/Command.php(148): PHPUnit\TextUI\TestRunner->run(Object(PHPUnit\Framework\TestSuite), Array, Array, true)
#6 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/Command.php(101): PHPUnit\TextUI\Command->run(Array, true)
#7 /Users/ybelenko/Sites/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#8 {main}
ERRORS!
Tests: 73, Assertions: 140, Errors: 8, Skipped: 15.

@dkarlovi
Copy link
Contributor

dkarlovi commented Oct 6, 2020

@ybelenko this is the same issue as before, no? Doesn't seem caused by this PR, it's broken in master already.

@ybelenko
Copy link
Contributor

ybelenko commented Oct 6, 2020

@dkarlovi Yes, but @wing328 said:

Let's see if that fixes the CI issue.

I've checked it does not. 😄

@dkarlovi
Copy link
Contributor

dkarlovi commented Oct 6, 2020

Oh, sorry, misunderstanding. 😁

The errors point to HTTP related issues, is the demo server still available and operational at the URL in question?

@wing328
Copy link
Member

wing328 commented Oct 8, 2020

If you run the test locally, the tests (HTTP calls) are made to the public petstore server, which has rejected requests from API clients generated by openapi-generator if I'm not mistaken.

You can either leverage the CIs (which run a local instance of the petstore server) or run the petstore server locally and update the host table accordingly.

@dkarlovi
Copy link
Contributor

dkarlovi commented Oct 8, 2020

@wing328 so why does CI fail if it's running a local copy of petstore server? This should be fixed separately then since the project build is failing for quite a while, at least PHP tests are failing because of it. I shouldn't be required to edit my host config to run the tests.

@wing328
Copy link
Member

wing328 commented Oct 25, 2020

so why does CI fail if it's running a local copy of petstore server?

A few possibles causes such as failures to download dependencies (libraries/modules) as we've seen public repositories throttling our connections when there are too many PRs.

@wing328 wing328 merged commit e11a427 into OpenAPITools:master Oct 25, 2020
@wing328 wing328 added this to the 5.0.0 milestone Oct 25, 2020
@wing328 wing328 changed the title changed request method from protected to public Changed request method from protected to public Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants