Skip to content

Commit 4d9fc82

Browse files
committed
Final lil' papercuts
1 parent 0e93e59 commit 4d9fc82

File tree

3 files changed

+37
-25
lines changed

3 files changed

+37
-25
lines changed

content/docs/get-started/aws/deploy-changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ Notice that your `index.html` file has been added to the bucket:
108108
```
109109

110110
{{% choosable language javascript %}}
111+
111112
Now that your `index.html` is in your bucket, modify the program file to have the bucket serve `index.html` as a static website. First, set the `website` property on your bucket.
112113

113114
```javascript
@@ -138,6 +139,7 @@ exports.bucketEndpoint = pulumi.interpolate`http://${bucket.websiteEndpoint}`;
138139
{{% /choosable %}}
139140

140141
{{% choosable language typescript %}}
142+
141143
Now that your `index.html` is in your bucket, modify the program file to have the bucket serve `index.html` as a static website. First, set the `website` property on your bucket.
142144

143145
```typescript
@@ -168,6 +170,7 @@ export const bucketEndpoint = pulumi.interpolate`http://${bucket.websiteEndpoint
168170
{{% /choosable %}}
169171

170172
{{% choosable language python %}}
173+
171174
Now that your `index.html` is in your bucket, modify the program file to have the bucket serve `index.html` as a static website. First, set the `website` property on your bucket.
172175

173176
```python
@@ -198,6 +201,7 @@ pulumi.export('bucket_endpoint', pulumi.Output.concat('http://', bucket.website_
198201
{{% /choosable %}}
199202

200203
{{% choosable language go %}}
204+
201205
Now that your `index.html` is in your bucket, modify the program to have the bucket serve `index.html` as a static website. First, set the `Website` property on your bucket.
202206

203207
```go
@@ -228,6 +232,7 @@ ctx.Export("bucketEndpoint", pulumi.Sprintf("http://%s", bucket.WebsiteEndpoint)
228232
{{% /choosable %}}
229233

230234
{{% choosable language csharp %}}
235+
231236
Now that your `index.html` is in your bucket, modify the program to have the bucket serve `index.html` as a static website. First, set the `Website` property on your bucket.
232237

233238
```csharp

content/docs/guides/adopting/import.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ application.
6262

6363
{{< chooser language "typescript,python,csharp,go" >}}
6464

65-
{{< choosable language typescript >}}
65+
{{% choosable language typescript %}}
6666

6767
```typescript
6868
import * as pulumi from "@pulumi/pulumi";
@@ -77,8 +77,8 @@ const demo = new aws.s3.Bucket("infra-logs", {
7777
});
7878
```
7979

80-
{{< /choosable >}}
81-
{{< choosable language python >}}
80+
{{% /choosable %}}
81+
{{% choosable language python %}}
8282

8383
```python
8484
import pulumi
@@ -91,8 +91,8 @@ demo = aws.s3.Bucket("infra-logs",
9191
opts=ResourceOptions(protect=True))
9292
```
9393

94-
{{< /choosable >}}
95-
{{< choosable language go >}}
94+
{{% /choosable %}}
95+
{{% choosable language go %}}
9696

9797
```go
9898
package main
@@ -117,8 +117,8 @@ func main() {
117117
}
118118
```
119119

120-
{{< /choosable >}}
121-
{{< choosable language csharp >}}
120+
{{% /choosable %}}
121+
{{% choosable language csharp %}}
122122

123123
```csharp
124124
using Pulumi;
@@ -142,7 +142,7 @@ class MyStack : Stack
142142
}
143143
```
144144

145-
{{< /choosable >}}
145+
{{% /choosable %}}
146146
{{< /chooser >}}
147147

148148
After successfully importing a resource and adding the generated code to your program, you can run `pulumi up` and all subsequent operations

content/docs/guides/testing/unit.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ menu:
1010

1111
Pulumi programs are authored in a general-purpose language like TypeScript, Python, Go, or C#. The full power of each language is available, including access to tools and libraries for that runtime, including testing frameworks.
1212

13-
When running an update, your Pulumi program talks to the Pulumi CLI to orchestrate the deployment. The idea of **unit tests** is to cut this communication channel and replace the engine with mocks. The mocks respond to the commands from within the same OS process and return dummy data for each call that your Pulumi program makes.
13+
When running an update, your Pulumi program talks to the Pulumi CLI to orchestrate the deployment. The idea of _unit tests_ is to cut this communication channel and replace the engine with mocks. The mocks respond to the commands from within the same OS process and return dummy data for each call that your Pulumi program makes.
1414

1515
Because mocks don't execute any real work, unit tests run very fast. Also, they can be made deterministic because tests don't depend on the behavior of any external system.
1616

@@ -42,7 +42,7 @@ Our starting code is loosely based on the [aws-js-webserver example](https://git
4242

4343
{{% choosable language "typescript" %}}
4444

45-
**index.ts**:
45+
index.ts:
4646

4747
```typescript
4848
import * as aws from "@pulumi/aws";
@@ -67,7 +67,7 @@ export const server = new aws.ec2.Instance("web-server-www", {
6767
{{% /choosable %}}
6868
{{% choosable language "python" %}}
6969

70-
**infra.py**:
70+
infra.py:
7171

7272
```python
7373
import pulumi
@@ -90,7 +90,7 @@ server = ec2.Instance('web-server-www;',
9090
{{% /choosable %}}
9191
{{% choosable language "go" %}}
9292

93-
**main.go**:
93+
main.go:
9494

9595
```go
9696
package main
@@ -148,7 +148,7 @@ func createInfrastructure(ctx *pulumi.Context) (*infrastructure, error) {
148148
{{% /choosable %}}
149149
{{% choosable language "csharp" %}}
150150

151-
**WebserverStack.cs**:
151+
WebserverStack.cs:
152152

153153
``` csharp
154154
using Pulumi;
@@ -233,7 +233,8 @@ dotnet add package FluentAssertions
233233
Let's add the following code to mock the external calls to the Pulumi CLI.
234234

235235
{{% choosable language "typescript" %}}
236-
**ec2tests.ts**
236+
237+
ec2tests.ts:
237238

238239
```ts
239240
import * as pulumi from "@pulumi/pulumi";
@@ -255,7 +256,7 @@ pulumi.runtime.setMocks({
255256

256257
{{% choosable language python %}}
257258

258-
**test_ec2.py**:
259+
test_ec2.py:
259260

260261
```python
261262
import pulumi
@@ -272,7 +273,8 @@ pulumi.runtime.set_mocks(MyMocks())
272273
{{% /choosable %}}
273274

274275
{{% choosable language go %}}
275-
**main_test.go**
276+
277+
main_test.go:
276278

277279
```go
278280
import (
@@ -293,7 +295,8 @@ func (mocks) Call(token string, args resource.PropertyMap, provider string) (res
293295
{{% /choosable %}}
294296

295297
{{% choosable language "csharp" %}}
296-
**Testing.cs**
298+
299+
Testing.cs:
297300

298301
```csharp
299302
public static class Testing
@@ -320,7 +323,7 @@ The definition of the mocks interface is available at the [runtime API reference
320323
{{% choosable language "typescript" %}}
321324
The overall structure and scaffolding of our tests will look like any ordinary Mocha testing:
322325

323-
**ec2tests.ts**:
326+
ec2tests.ts:
324327

325328
```typescript
326329
import * as pulumi from "@pulumi/pulumi";
@@ -353,7 +356,7 @@ describe("Infrastructure", function() {
353356
{{% choosable language "python" %}}
354357
The overall structure and scaffolding of our tests will look like any ordinary Python's unittest testing:
355358

356-
**test_ec2.py**:
359+
test_ec2.py:
357360

358361
```python
359362
import unittest
@@ -376,7 +379,7 @@ class TestingWithMocks(unittest.TestCase):
376379

377380
The overall structure and scaffolding of our tests will look like any ordinary Go test:
378381

379-
**main_test.go**:
382+
main_test.go:
380383

381384
```go
382385
package main
@@ -416,7 +419,7 @@ func TestInfrastructure(t *testing.T) {
416419
{{% choosable language "csharp" %}}
417420
The overall structure and scaffolding of our tests will look like any ordinary NUnit testing:
418421

419-
**WebserverStackTests.cs**:
422+
WebserverStackTests.cs:
420423

421424
```csharp
422425
using NUnit.Framework;
@@ -784,7 +787,8 @@ Total tests: 3
784787
Let's fix our program to comply:
785788

786789
{{% choosable language "typescript" %}}
787-
**index.ts**
790+
791+
index.ts:
788792

789793
```typescript
790794
import * as aws from "@pulumi/aws";
@@ -805,7 +809,8 @@ export const server = new aws.ec2.Instance("web-server-www", {
805809

806810
{{% /choosable %}}
807811
{{% choosable language "python" %}}
808-
**infra.py**
812+
813+
infra.py:
809814

810815
```python
811816
import pulumi
@@ -824,7 +829,8 @@ server = ec2.Instance('web-server-www;',
824829

825830
{{% /choosable %}}
826831
{{% choosable language "go" %}}
827-
**main.go**
832+
833+
main.go:
828834

829835
```go
830836
package main
@@ -873,7 +879,8 @@ func createInfrastructure(ctx *pulumi.Context) (*infrastructure, error) {
873879

874880
{{% /choosable %}}
875881
{{% choosable language "csharp" %}}
876-
**WebserverStack.cs**
882+
883+
WebserverStack.cs:
877884

878885
```csharp
879886
using Pulumi;

0 commit comments

Comments
 (0)