googleapis / doc-pipeline

Apache License 2.0
10 stars 11 forks source link

tests.test_generate: test_generate failed #485

Closed flaky-bot[bot] closed 1 year ago

flaky-bot[bot] commented 1 year ago

Note: #451 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.


commit: bf4d7b0de902b5844bd976783c666d04c57b749f buildURL: Build Status, Sponge status: failed

Test output
yaml_dir = PosixPath('/tmp/pytest-of-kbuilder/pytest-0/test_generate0')
tmpdir = PosixPath('/tmp/pytest-of-kbuilder/pytest-0/test_generate0')

    def test_generate(yaml_dir, tmpdir):
        tmpdir = pathlib.Path(tmpdir)
        test_bucket, storage_client = init_test()

        bucket, yaml_blob, html_blob = setup_testdata(yaml_dir, storage_client, test_bucket)

        # Test for non-api directory content
        run_generate(storage_client, test_bucket)

        verify_content(html_blob, tmpdir)

        # Ensure xref file was properly uploaded. Also ensure download_xrefs gets
        # the right content.
        path = generate.get_xref("devsite://go/cloud.google.com/go/storage", bucket, tmpdir)
        assert path != ""
        assert pathlib.Path(path).exists()

        # Force regeneration and verify the timestamp is different.
        html_blob = bucket.get_blob(html_blob.name)
        t1 = html_blob.updated
        generate.build_all_docs(test_bucket, storage_client)
        html_blob = bucket.get_blob(html_blob.name)
        t2 = html_blob.updated
        assert t1 != t2, "HTML is updated"

        # Force regeneration of a single doc and verify timestamp.
        generate.build_one_doc(test_bucket, yaml_blob.name, storage_client)
        html_blob = bucket.get_blob(html_blob.name)
        t3 = html_blob.updated
        assert t2 != t3, "single doc gets updated"

        # Force generation of Go docs and verify timestamp.
        language = "go"
        generate.build_language_docs(test_bucket, language, storage_client)
        html_blob = bucket.get_blob(html_blob.name)
        t4 = html_blob.updated
        assert t3 != t4, "Go docs get updated"

        # Force generation of Python docs, verify Go HTML timestamp does not change.
        language = "python"
        generate.build_language_docs(test_bucket, language, storage_client)
        html_blob = bucket.get_blob(html_blob.name)
>       t5 = html_blob.updated
E       AttributeError: 'NoneType' object has no attribute 'updated'

tests/test_generate.py:292: AttributeError
flaky-bot[bot] commented 1 year ago

Test passed for commit 666be9b66b5abf42d3808ea66e831bfb3fe87105 (Build Status, Sponge)! Closing this issue.