Skip to content

Commit

Permalink
Add test for legacy style names (#15384)
Browse files Browse the repository at this point in the history
Long term I want to introduce a new snake_case based naming system to
schemas. There's an internal design doc about this at
https://docs.google.com/document/d/1ns07htpLjw0dJPn5p7TBPVULvwwYc1Pl7l1c1jdGXoY/edit.

As part of that we get the nice feature that _nearly_ all current names
are either valid and the same in both system (e.g. "foo"), or they look
different in the current system (e.g. "fooBar"). But there are a handful
of odd cases where we have providers using names that look like they
should be new style snake case names (e.g. kubernetes has a load of
"x_kubernetes_" properties).

To provide a way to ensure k8s can stay on the current name generation
(even though it gives pretty odd results) this change adds a test with a
schema demonstrating a load of snake_case names. When we do add the new
naming system this test _should not diff_, excepting possibly setting an
option if the new naming system is opt-out rather than opt-in.
  • Loading branch information
Frassle committed Feb 15, 2024
1 parent 2ccbef6 commit 11eff25
Show file tree
Hide file tree
Showing 54 changed files with 3,619 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/codegen/testing/test/sdk_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ var PulumiPulumiSDKTests = []*SDKTest{
Directory: "unions-inline",
Description: "Testing the use of unions/oneOf in the schema inline with the property definition.",
},
{
Directory: "legacy-names",
Description: "Testing the use of snake_case names and tokens.",
Skip: codegen.NewStringSet("go/test"),
},
}

var genSDKOnly bool
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "HTTP_module"
title_tag: "legacy_names.HTTP_module"
meta_desc: "Explore the resources and functions of the legacy_names.HTTP_module module."
layout: api
no_edit_this_page: true
---

<!-- WARNING: this file was generated by test. -->
<!-- Do not edit by hand unless you're certain you know what you are doing! -->

Explore the resources and functions of the legacy_names.HTTP_module module.

<h2 id="package-details">Package Details</h2>
<dl class="package-details">
<dt>Repository</dt>
<dd><a href="">legacy_names </a></dd>
<dt>License</dt>
<dd></dd>
<dt>Version</dt>
<dd>1.0.0</dd>
</dl>

34 changes: 34 additions & 0 deletions pkg/codegen/testing/test/testdata/legacy-names/docs/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "legacy_names"
title_tag: "legacy_names Package"
meta_desc: ""
layout: api
no_edit_this_page: true
---

<!-- WARNING: this file was generated by test. -->
<!-- Do not edit by hand unless you're certain you know what you are doing! -->



<h2 id="modules">Modules</h2>
<ul class="api">
<li><a href="http_module/" title="HTTP_module">HTTP_module</a></li>
</ul>

<h2 id="resources">Resources</h2>
<ul class="api">
<li><a href="example_resource/" title="Example_resource">Example_resource</a></li>
<li><a href="provider/" title="Provider">Provider</a></li>
</ul>

<h2 id="package-details">Package Details</h2>
<dl class="package-details">
<dt>Repository</dt>
<dd><a href="">legacy_names </a></dd>
<dt>License</dt>
<dd></dd>
<dt>Version</dt>
<dd>1.0.0</dd>
</dl>

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"emittedFiles": [
"HTTP_module/_index.md",
"_index.md",
"example_resource/_index.md",
"provider/_index.md"
]
}

Large diffs are not rendered by default.

0 comments on commit 11eff25

Please sign in to comment.