googleapis / synthtool

Apache License 2.0
87 stars 85 forks source link

fix: rename rst files to avoid conflict with service names #1856

Closed dizcology closed 11 months ago

dizcology commented 1 year ago

Python GAPIC generator will rename the template rst files, adding trailing underscore to avoid name collision when an API has a service called Services https://github.com/googleapis/gapic-generator-python/pull/1706: services.rst -> services_.rst types.rst -> types_.rst

This PR makes the corresponding change in index.rst files.

SurferJeffAtGoogle commented 1 year ago

Please re-assign to me when ready for review.

suztomo commented 1 year ago

Kokoro CI failed: https://source.cloud.google.com/results/invocations/a1603b4f-1b4d-4a21-9cfc-afdff613edd9/targets/cloud-devrel%2Fclient-libraries%2Fsynthtool%2Fpresubmit/log

=================================== FAILURES ===================================
___________________________ test_walk_through_apiary ___________________________

mock_subproc_popen = <MagicMock name='run' id='139646549292848'>

    @patch("subprocess.run")
    def test_walk_through_apiary(mock_subproc_popen):
        process_mock = Mock()
        attrs = {"communicate.return_value": ("output", "error")}
        process_mock.configure_mock(**attrs)
        mock_subproc_popen.return_value = process_mock
        dirs = node.walk_through_apiary(FIXTURES / "node_apiary", "src/apis/**/*")
        assert not mock_subproc_popen.called
>       assert re.search("src/apis/admin", dirs[0])
E       AssertionError: assert None
E        +  where None = <function search at 0x7f020127b760>('src/apis/admin', '/tmpfs/src/github/synthtool/tests/fixtures/node_apiary/src/apis/docs')
E        +    where <function search at 0x7f020127b760> = re.search
parthea commented 1 year ago

The specific test that is failing is part of the node templates.tests/test_node.py::test_walk_through_apiary . @sofisl Do you know who would be the best person to take a look?