-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from leancodepl/publisher/funnelled-service-tests
Funnel in µsvcs tests
- Loading branch information
Showing
39 changed files
with
1,391 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Funnel in µsvc tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags-ignore: [ "*-v*" ] | ||
paths: | ||
- "publisher/**" | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- "publisher/**" | ||
|
||
jobs: | ||
setup-cluster-and-test: | ||
name: Test Funnel on cluster with multiple scaled services | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./publisher | ||
env: | ||
DOTNET_VERSION: 8.0.100-rc.1.23463.5 | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | ||
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
- name: Setup Tilt | ||
uses: yokawasa/[email protected] | ||
with: | ||
tilt: v0.33.6 | ||
setup-tools: | | ||
tilt | ||
- name: Create test cluster | ||
uses: AbsaOSS/k3d-action@v2 | ||
with: | ||
cluster-name: testapp | ||
args: --config=publisher/funnel_test_cluster/k3d.yaml | ||
- name: Make the script files executable | ||
run: chmod +x funnel_test_cluster/subst_tpl_envs.sh | ||
- name: Run Tilt CI with tests | ||
run: tilt ci --context k3d-testapp -f funnel_test_cluster/Tiltfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# JetBrains Rider | ||
**/.idea/ | ||
|
||
**/out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,238 @@ | ||
load('ext://namespace', 'namespace_create') | ||
|
||
allow_k8s_contexts('k3d-testapp') | ||
default_registry('k3d-testapp-registry.local.lncd.pl:21345') | ||
|
||
# All services needed for tests | ||
|
||
local_resource( | ||
'build-testappfunnel', | ||
'dotnet publish -o out/testapp_funnel ../test/LeanCode.Pipe.Funnel.TestAppFunnel', | ||
deps=['../src', '../test/LeanCode.Pipe.Funnel.TestAppFunnel'], | ||
ignore=['../**/obj', '../**/bin'], | ||
labels=['test-services'], | ||
) | ||
|
||
local_resource( | ||
'build-testapp1', | ||
'dotnet publish -o out/testapp1 ../test/LeanCode.Pipe.Funnel.TestApp1', | ||
deps=['src', '../test/LeanCode.Pipe.Funnel.TestApp1'], | ||
ignore=['../**/obj', '../**/bin'], | ||
labels=['test-services'], | ||
) | ||
|
||
local_resource( | ||
'build-testapp2', | ||
'dotnet publish -o out/testapp2 ../test/LeanCode.Pipe.Funnel.TestApp2', | ||
deps=['src', '../test/LeanCode.Pipe.Funnel.TestApp2'], | ||
ignore=['../**/obj', '../**/bin'], | ||
labels=['test-services'], | ||
) | ||
|
||
docker_build( | ||
'testapp_funnel', | ||
'.', | ||
dockerfile='testapp_funnel.dockerfile', | ||
only = ['out/testapp_funnel'], | ||
) | ||
|
||
docker_build( | ||
'testapp1', | ||
'.', | ||
dockerfile='testapp1.dockerfile', | ||
only = ['out/testapp1'], | ||
) | ||
|
||
docker_build( | ||
'testapp2', | ||
'.', | ||
dockerfile='testapp2.dockerfile', | ||
only = ['out/testapp2'], | ||
) | ||
|
||
k8s_yaml('rabbitmq.yaml') | ||
k8s_resource('rabbitmq', labels=['test-services']) | ||
|
||
# No scaling tests | ||
|
||
namespace_create('no-scaling') | ||
|
||
local_resource( | ||
'build-no-scaling-tests', | ||
'dotnet publish -o out/no_scaling_tests ../test/LeanCode.Pipe.Funnel.NoScalingTests', | ||
deps=[ | ||
'../src', | ||
'../test/LeanCode.Pipe.Funnel.TestAppFunnel', | ||
'../test/LeanCode.Pipe.Funnel.TestApp1', | ||
'../test/LeanCode.Pipe.Funnel.NoScalingTests' ], | ||
ignore=['../**/obj', '../**/bin'], | ||
labels=['no-scaling-tests'] | ||
) | ||
|
||
docker_build( | ||
'no_scaling_tests', | ||
'.', | ||
dockerfile='no_scaling/tests.dockerfile', | ||
only = ['out/no_scaling_tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh no_scaling funnel.yaml')) | ||
k8s_resource( | ||
'no-scaling-funnel', | ||
resource_deps=['rabbitmq'], | ||
labels=['no-scaling-tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh no_scaling testapp1.yaml')) | ||
k8s_resource( | ||
'no-scaling-testapp1', | ||
resource_deps=['rabbitmq'], | ||
labels=['no-scaling-tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh no_scaling tests.yaml')) | ||
k8s_resource( | ||
'no-scaling-tests', | ||
resource_deps=['no-scaling-funnel', 'no-scaling-testapp1'], | ||
labels=['no-scaling-tests'] | ||
) | ||
|
||
# Scaled target service tests | ||
|
||
namespace_create('scaled-target-service') | ||
|
||
local_resource( | ||
'build-scaled-target-service-tests', | ||
'dotnet publish -o out/scaled_target_service_tests ../test/LeanCode.Pipe.Funnel.ScaledTargetServiceTests', | ||
deps=[ | ||
'../src', | ||
'../test/LeanCode.Pipe.Funnel.TestAppFunnel', | ||
'../test/LeanCode.Pipe.Funnel.TestApp1', | ||
'../test/LeanCode.Pipe.Funnel.ScaledTargetServiceTests' ], | ||
ignore=['../**/obj', '../**/bin'], | ||
labels=['scaled-target-service-tests'] | ||
) | ||
|
||
docker_build( | ||
'scaled_target_service_tests', | ||
'.', | ||
dockerfile='scaled_target_service/tests.dockerfile', | ||
only = ['out/scaled_target_service_tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh scaled_target_service funnel.yaml')) | ||
k8s_resource( | ||
'scaled-target-service-funnel', | ||
resource_deps=['rabbitmq'], | ||
labels=['scaled-target-service-tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh scaled_target_service testapp1.yaml')) | ||
k8s_resource( | ||
'scaled-target-service-testapp1', | ||
resource_deps=['rabbitmq'], | ||
labels=['scaled-target-service-tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh scaled_target_service tests.yaml')) | ||
k8s_resource( | ||
'scaled-target-service-tests', | ||
resource_deps=['scaled-target-service-funnel', 'scaled-target-service-testapp1'], | ||
labels=['scaled-target-service-tests'] | ||
) | ||
|
||
# Scaled funnel tests | ||
|
||
namespace_create('scaled-funnel') | ||
|
||
local_resource( | ||
'build-scaled-funnel-tests', | ||
'dotnet publish -o out/scaled_funnel_tests ../test/LeanCode.Pipe.Funnel.ScaledFunnelTests', | ||
deps=[ | ||
'../src', | ||
'../test/LeanCode.Pipe.Funnel.TestAppFunnel', | ||
'../test/LeanCode.Pipe.Funnel.TestApp1', | ||
'../test/LeanCode.Pipe.Funnel.ScaledFunnelTests' ], | ||
ignore=['../**/obj', '../**/bin'], | ||
labels=['scaled-funnel-tests'] | ||
) | ||
|
||
docker_build( | ||
'scaled_funnel_tests', | ||
'.', | ||
dockerfile='scaled_funnel/tests.dockerfile', | ||
only = ['out/scaled_funnel_tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh scaled_funnel funnel.yaml')) | ||
k8s_resource( | ||
'scaled-funnel-funnel', | ||
resource_deps=['rabbitmq'], | ||
labels=['scaled-funnel-tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh scaled_funnel testapp1.yaml')) | ||
k8s_resource( | ||
'scaled-funnel-testapp1', | ||
resource_deps=['rabbitmq'], | ||
labels=['scaled-funnel-tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh scaled_funnel tests.yaml')) | ||
k8s_resource( | ||
'scaled-funnel-tests', | ||
resource_deps=['scaled-funnel-funnel', 'scaled-funnel-testapp1'], | ||
labels=['scaled-funnel-tests'] | ||
) | ||
|
||
# Multiple services tests | ||
|
||
namespace_create('multiple-services') | ||
|
||
local_resource( | ||
'build-multiple-services-tests', | ||
'dotnet publish -o out/multiple_services_tests ../test/LeanCode.Pipe.Funnel.MultipleServicesTests', | ||
deps=[ | ||
'../src', | ||
'../test/LeanCode.Pipe.Funnel.TestAppFunnel', | ||
'../test/LeanCode.Pipe.Funnel.TestApp1', | ||
'../test/LeanCode.Pipe.Funnel.TestApp2', | ||
'../test/LeanCode.Pipe.Funnel.MultipleServicesTests' ], | ||
ignore=['../**/obj', '../**/bin'], | ||
labels=['multiple-services-tests'] | ||
) | ||
|
||
docker_build( | ||
'multiple_services_tests', | ||
'.', | ||
dockerfile='multiple_services/tests.dockerfile', | ||
only = ['out/multiple_services_tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh multiple_services funnel.yaml')) | ||
k8s_resource( | ||
'multiple-services-funnel', | ||
resource_deps=['rabbitmq'], | ||
labels=['multiple-services-tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh multiple_services testapp1.yaml')) | ||
k8s_resource( | ||
'multiple-services-testapp1', | ||
resource_deps=['rabbitmq'], | ||
labels=['multiple-services-tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh multiple_services testapp2.yaml')) | ||
k8s_resource( | ||
'multiple-services-testapp2', | ||
resource_deps=['rabbitmq'], | ||
labels=['multiple-services-tests'] | ||
) | ||
|
||
k8s_yaml(local('./subst_tpl_envs.sh multiple_services tests.yaml')) | ||
k8s_resource( | ||
'multiple-services-tests', | ||
resource_deps=['multiple-services-funnel', 'multiple-services-testapp1', 'multiple-services-testapp2'], | ||
labels=['multiple-services-tests'] | ||
) |
Oops, something went wrong.