Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 38 additions & 22 deletions src/frontend/src/content/docs/ja/aspireconf/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ giscus: false
head:
- tag: title
content: Aspire Conf — 3月23日 9:00(PT)
description: 3月23日に開催される Aspire Conf に向けて、ぜひ予定を確保のうえご参加ください。無料のライブ配信イベントです。Aspire を体験し、分散アプリやエージェントの構築・デプロイ方法をどのように変革できるのかをご覧ください。
description: 3月23日に開催される Aspire Conf に向けて、ぜひ予定を確保のうえご参加ください。無料のライブ配信イベントです。Aspire を体験し、分散アプリやエージェントの構築・デプロイ方法をどのように変革できるのかをご覧ください。
template: splash
editUrl: false
next: false
prev: false
hero:
tagline: Aspire Conf <h6>3月 23日, 9:00 PT</h6> <p>日程を確保のうえ、無料のライブ配信イベントにぜひご参加ください。</p><p> Aspire を体験し、分散アプリやエージェントの構築・デプロイ方法をどのように変革できるのかをご覧ください。</p>
image:
Expand All @@ -21,39 +22,54 @@ hero:
data-track-action-type: 'CL'
data-track-behavior: 'DOWNLOAD'
data-bi-bhvr: '40'
- text: YouTube でご覧ください
link: https://www.youtube.com/watch?v=6j61K9Sna2M
- text: ライブでご覧ください
link: '#ライブ配信を見る'
variant: secondary
---

import { CardGrid, LinkCard } from '@astrojs/starlight/components';
import {
CardGrid,
LinkCard,
Tabs,
TabItem,
} from '@astrojs/starlight/components';
import SessionGrid from '@components/SessionGrid.astro';
import { sessions } from '@data/aspireconf-sessions';
import YouTubeEmbed from '@components/YouTubeEmbed.astro';
import TwitchEmbed from '@components/TwitchEmbed.astro';

<h2 style="margin-top: 0;">新しい Aspire にぜひ触れてみてください</h2>

<div style="max-width: 100%;">

Aspire を体験し、それが分散アプリやエージェントの構築・デプロイ方法をどのように変革するかを学びましょう。コード中心のコントロールにより、書き直しなしでシンプルなシステムから複雑なシステムまでをオーケストレーションおよび可観測化し、どこにでもデプロイできます。新しい Aspire にぜひ触れてみてください。

あらゆるスキルレベルの方に向けたセッションをご用意しています。使用している言語、フレームワーク、コンピュート環境、クラウド、コーディングエージェントを問わず、すべての開発者を歓迎します。Aspire がどのようにして AI 支援開発を実用的かつ楽しいものにするためのプリミティブを提供するのかをご覧ください。

<a href="https://www.youtube.com/watch?v=6j61K9Sna2M">YouTube</a> および <a href="https://www.twitch.tv/aspiredotdev">Twitch</a>, で配信します。ぜひライブで質問や交流をお楽しみください。皆さまのご参加をお待ちしています!
<a href="https://www.youtube.com/watch?v=6j61K9Sna2M">YouTube</a> および <a href="https://www.twitch.tv/aspiredotdev">Twitch</a> でライブ配信します。ぜひライブで質問や交流をお楽しみください。皆さまのご参加をお待ちしています!

**詳細なアジェンダは続報をお待ちください。**
<br />
</div>

<CardGrid>
<LinkCard
icon="rocket"
href="/ja/get-started/install-cli/"
title="Aspire を入手"
description="Aspire をインストールして、ワークフローを効率化しましょう。"
/>
<LinkCard
icon="open-book"
variant="secondary"
href="/ja/docs/"
title="ドキュメントを見る"
description="Aspire を使ってアプリをモデリングし、実行し、デプロイする方法を学びましょう。"
/>
</CardGrid>
{sessions.length > 0 && (

<>
<h2>セッションを探索</h2>

<p class='pt-2 pb-2'>あらゆるスキルレベルの方に向けたセッションをご用意しています。使用している言語、フレームワーク、コンピュート環境、クラウド、コーディングエージェントを問わず、すべての開発者を歓迎します。Aspire がどのようにして AI 支援開発を実用的かつ楽しいものにするためのプリミティブを提供するのかをご覧ください。</p>

<SessionGrid sessions={sessions} />
</>
)}

## ライブ配信を見る

ライブ配信が開始されると、こちらの YouTube または Twitch でご視聴いただけます。

<Tabs syncKey="live-stream-source">
<TabItem value="youtube" label="YouTube" icon="youtube">
<YouTubeEmbed videoId="6j61K9Sna2M" title="Aspire Conf 2026 Livestream" />
</TabItem>
<TabItem value="twitch" label="Twitch" icon="twitch">
<TwitchEmbed channel="aspiredotdev" title="Aspire Conf on Twitch" />
</TabItem>
</Tabs>
2 changes: 1 addition & 1 deletion src/frontend/src/content/docs/ja/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ editUrl: false
next: false
banner:
content: |
<strong>🚀 Aspire 13.1 がリリースされました!</strong> — <a href="/ja/whats-new/aspire-13-1/">Aspire 13.1 の新機能を確認。</a>
<strong>3月23日に開催される無料オンラインイベント #AspireConf で、新しい Aspire にぜひ触れてみてください!<strong> — <a href="/ja/aspireconf/">予定を確保</a>
hero:
tagline: あなたのスタックをもっとシンプルに。 <p>フロントエンド、API、コンテナ、データベースを再実装不要、制限なしでオーケストレーションします。Aspire を拡張してあらゆるプロジェクトを強化しましょう。</p>
image:
Expand Down
11 changes: 4 additions & 7 deletions src/frontend/src/content/docs/ja/testing/manage-app-host.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ Aspire を使って機能テストや統合テストを書く際には、AppHost

Aspire でテストを書く場合は、[Aspire.Hosting.Testing](https://www.nuget.org/packages/Aspire.Hosting.Testing) NuGet パッケージを使用します。このパッケージには、テスト内で AppHost インスタンスを管理するためのいくつかのヘルパークラスが含まれています。

## `DistributedApplicationTestingBuilder` クラスを使用する
### `DistributedApplicationTestingBuilder` クラスを使用する

[最初のテストを書くチュートリアル](/ja/testing/write-your-first-test/)
では、AppHost インスタンスを作成するために使用できる DistributedApplicationTestingBuilder クラスを紹介しました:
[最初のテストを書くチュートリアル](/ja/testing/write-your-first-test/) では、AppHost インスタンスを作成するために使用できる DistributedApplicationTestingBuilder クラスを紹介しました:

```csharp
var appHost = await DistributedApplicationTestingBuilder
Expand Down Expand Up @@ -125,9 +124,8 @@ public class WebTests

テスト実行の開始時に AppHost をフィールドとして保持しておくことで、各テストから再作成することなく AppHost にアクセスできるようになり、テスト実行にかかる時間を短縮できます。そしてテスト実行が完了すると AppHost は破棄され、コンテナーなど、テスト実行中に作成されたすべてのリソースがクリーンアップされます。

## AppHost に引数を渡す
### AppHost に引数を渡す

You can access the arguments from your AppHost with the `args` parameter. Arguments are also passed to [.NET's configuration system](https://learn.microsoft.com/dotnet/core/extensions/configuration), so you can override many configuration settings this way. In the following example, you override the [environment](https://learn.microsoft.com/aspnet/core/fundamentals/environments) by specifying it as a command line option:
AppHost では、`args` パラメーターを使って引数にアクセスできます。引数は [.NET の構成システム](https://learn.microsoft.com/ja-jp/dotnet/core/extensions/configuration) にも渡されるため、この方法で多くの構成設定を上書きできます。次の例では、コマンドライン オプションとして指定することで [ASP.NET Core ランタイム環境](https://learn.microsoft.com/ja-jp/aspnet/core/fundamentals/environments) を上書きしています:

```csharp
Expand All @@ -150,7 +148,6 @@ if (builder.Configuration.GetValue("UseVolumes", true))
}
```

In test code, you pass `"UseVolumes=false"` in the `args` to the AppHost:
テストコードでは、AppHost の `args` に `"UseVolumes=false"` を渡します:

```csharp
Expand All @@ -170,7 +167,7 @@ public async Task DisableVolumesFromTest()
}
```

## `DistributedApplicationFactory` クラスを使用する
### `DistributedApplicationFactory` クラスを使用する

`DistributedApplicationTestingBuilder` クラスは多くの場面で便利ですが、たとえば builder を作成する前にコードを実行したい、あるいは AppHost をビルドした後に処理を挟みたいなど、AppHost の起動フローをより細かく制御したいケースもあります。そうした場合は、`DistributedApplicationFactory` クラスを自分で実装します。これは `DistributedApplicationTestingBuilder` が内部的に利用している仕組みです。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import PivotSelector from '@components/PivotSelector.astro';
import Pivot from '@components/Pivot.astro';

<PivotSelector
title="使用するテストフレームワークを選択してください"
key="testing-framework"
options={[
{ id: 'xunit', title: 'xUnit.net' },
{ id: 'mstest', title: 'MSTest' },
{ id: 'nunit', title: 'NUnit' },
]}
title="使用するテストフレームワークを選択してください"
key="testing-framework"
options={[
{ id: 'xunit', title: 'xUnit.net' },
{ id: 'mstest', title: 'MSTest' },
{ id: 'nunit', title: 'NUnit' },
]}
/>

この記事では、Aspire ソリューション向けにテストプロジェクトを作成し、C# でテストを書き、それらを実行する方法を学びます。これらはユニットテストではなく、分散アプリケーションの各コンポーネントがどのように連携して動作するかを検証するための 機能テストおよび統合テスト です。Aspire では、xUnit.net、MSTest、NUnit 向けのテストプロジェクトテンプレートが提供されており、それぞれにサンプルテストが含まれているため、すぐに始めることができます。
Expand Down Expand Up @@ -384,15 +384,12 @@ public class IntegrationTest1

- `DistributedApplicationTestingBuilder.CreateAsync` API を使用して、AppHost を非同期に作成しています。
- `appHost` は `IDistributedApplicationTestingBuilder` のインスタンスで、AppHost を表します。
- appHost のサービス コレクションに対して、ログ設定および標準の HTTP レジリエンス ハンドラーを構成しています。詳細については [回復性がある HTTP アプリを構築する: 主要な開発パターン](https://learn.microsoft.com/ja-jp/dotnet/core/resilience/http-resilience)をご参照ください。
- The `appHost` has its `BuildAsync` method invoked, which returns the `DistributedApplication` instance as the `app`.
- `appHost` のサービス コレクションに対して、ログ設定および標準の HTTP レジリエンス ハンドラーを構成しています。詳細については [回復性がある HTTP アプリを構築する: 主要な開発パターン](https://learn.microsoft.com/ja-jp/dotnet/core/resilience/http-resilience)をご参照ください。
- `appHost.BuildAsync` を呼び出し、`DistributedApplication` インスタンスを `app` として取得しています。
- `app` を非同期に起動しています。
- `app.CreateHttpClient` を呼び出して、`webfrontend` リソース用の `HttpClient` を作成しています。
- `app.ResourceNotifications` を使用して、`webfrontend` リソースが正常状態になるまで待機しています。
- A simple HTTP GET request is made to the root of the `webfrontend` resource.
- `webfrontend` リソースのルートに対して、シンプルな HTTP GET リクエストを送信しています。
- The test asserts that the response status code is `OK`.
- レスポンスのステータス コードが OK(HTTP 200)であることを検証しています。

## リソースの環境変数をテストする
Expand All @@ -418,8 +415,12 @@ public class EnvVarTests
var frontend = builder.CreateResourceBuilder<ProjectResource>("webfrontend");

// 実行(Act)
var envVars = await frontend.Resource.GetEnvironmentVariableValuesAsync(
DistributedApplicationOperation.Publish);
var executionConfiguration = await ExecutionConfigurationBuilder.Create(frontend.Resource)
.WithEnvironmentVariablesConfig()
.BuildAsync(new(DistributedApplicationOperation.Publish), NullLogger.Instance, CancellationToken.None)
.ConfigureAwait(true);

var envVars = executionConfiguration.EnvironmentVariables.ToDictionary();

// 検証(Assert)
Assert.Contains(envVars, static (kvp) =>
Expand Down Expand Up @@ -454,8 +455,12 @@ public class EnvVarTests
var frontend = builder.CreateResourceBuilder<ProjectResource>("webfrontend");

// 実行(Act)
var envVars = await frontend.Resource.GetEnvironmentVariableValuesAsync(
DistributedApplicationOperation.Publish);
var executionConfiguration = await ExecutionConfigurationBuilder.Create(frontend.Resource)
.WithEnvironmentVariablesConfig()
.BuildAsync(new(DistributedApplicationOperation.Publish), NullLogger.Instance, CancellationToken.None)
.ConfigureAwait(true);

var envVars = executionConfiguration.EnvironmentVariables.ToDictionary();

// 検証(Assert)
CollectionAssert.Contains(envVars,
Expand Down Expand Up @@ -486,8 +491,12 @@ public class EnvVarTests
var frontend = builder.CreateResourceBuilder<ProjectResource>("webfrontend");

// 実行(Act)
var envVars = await frontend.Resource.GetEnvironmentVariableValuesAsync(
DistributedApplicationOperation.Publish);
var executionConfiguration = await ExecutionConfigurationBuilder.Create(frontend.Resource)
.WithEnvironmentVariablesConfig()
.BuildAsync(new(DistributedApplicationOperation.Publish), NullLogger.Instance, CancellationToken.None)
.ConfigureAwait(true);

var envVars = executionConfiguration.EnvironmentVariables.ToDictionary();

// 検証(Assert)
Assert.That(envVars, Does.Contain(
Expand All @@ -503,10 +512,10 @@ public class EnvVarTests
上記のコードでは、次のことを行っています:

- `DistributedApplicationTestingBuilder.CreateAsync` API を利用して、AppHost を非同期に作成しています。
- `builder` インスタンスは、`Resources` プロパティから 「webfrontend」 という名前の `IResourceWithEnvironment` インスタンスを取得するために使用されます
- `webfrontend` リソースに対して `GetEnvironmentVariableValuesAsync` を呼び出し、構成済みの環境変数を取得しています
- `GetEnvironmentVariableValuesAsync` 呼び出し時に `DistributedApplicationOperation.Publish` を渡し、バインディング式としてリソースに公開(Publish)される環境変数を対象にしています
- 返却された環境変数を用いて、テストでは `webfrontend` リソースに、`apiservice` リソースへ解決される HTTPS の環境変数が存在することを検証しています。
- `builder` インスタンスの `Resources` プロパティから 「webfrontend」 という名前の `IResourceWithEnvironment` インスタンスを取得しています
- `ExecutionConfigurationBuilder` を使用して `webfrontend` リソースの `ExecutionConfiguration` を構築し、`WithEnvironmentVariablesConfig` によって環境変数の構成を明示的に有効化しています
- `DistributedApplicationOperation.Publish` を指定して `BuildAsync` を呼び出し、未解決のバインディング式を含む、そのリソースに対して公開される環境変数を生成しています
- 返却された環境変数を用いて、テストでは `webfrontend` リソースが `apiservice` リソースへ解決される HTTPS の環境変数が存在することを検証しています。

## テストからログを取得する

Expand Down
Loading
Loading