Skip to content

Instantly share code, notes, and snippets.

View TsuyoshiUshio's full-sized avatar
🏠
Working from home

Tsuyoshi Ushio TsuyoshiUshio

🏠
Working from home
  • Microsoft
  • Kirkland
View GitHub Profile
public class ParallelTest01
{
[Fact]
public async Task Test1()
{
await Task.Delay(TimeSpan.FromSeconds(5));
Assert.True(true);
}
[Fact]
@TsuyoshiUshio
TsuyoshiUshio / launch.json
Created January 20, 2020 08:17
Go debugging for a single scenario.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
@TsuyoshiUshio
TsuyoshiUshio / test_helper.go
Created January 20, 2020 07:56
Helper method for IPAddress creation for service.
func WaitUntilServiceExternalIPsAvailable(t *testing.T, options *k8s.KubectlOptions, serviceName string, retries int, sleepBetweenRetries time.Duration) {
statusMsg := fmt.Sprintf("Wait for service %s to be provisioned.", serviceName)
message := retry.DoWithRetry(
t,
statusMsg,
retries,
sleepBetweenRetries,
func() (string, error) {
service, err := k8s.GetServiceE(t, options, serviceName)
if err != nil {
@TsuyoshiUshio
TsuyoshiUshio / aks_test.go
Last active January 20, 2020 07:40
terratest with custom helper.
:
terraform.InitAndApply(t, terraformOptions)
var ActualCount int32 = 0
cluster, err := GetManagedCluster(expectedResourceGroupName, expectedClusterName) // Custom helper method
assert.Nil(t, err)
ActualCount = *(*cluster.ManagedClusterProperties.AgentPoolProfiles)[0].Count
// Write assert
assert.Equal(t, int32(expectedAagentCount), ActualCount)
:
resources:
pipelines:
- pipeline: parent
source: Parent.CI
trigger:
branches:
- master
trigger: none
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
jobs:
- job: main
steps:
- script: echo "##vso[task.setvariable variable=FOO;isOutput=true]Bar"
@TsuyoshiUshio
TsuyoshiUshio / launch.json
Created October 28, 2019 01:33
Debug settings for attach binary
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to local process",
"type": "go",
"request": "attach",
"mode": "local",
"processId": 87235
},
"terminal.integrated.env.osx": {
"AZDO_ORG_SERVICE_URL":"https://dev.azure.com/<YOUR_ORG>",
"AZDO_PERSONAL_ACCESS_TOKEN":"<YOUR_AZDO_PAT>",
"AZDO_GITHUB_SERVICE_CONNECTION_PAT":"<YOUR_GITHUB_PAT>",
"AZDO_TEST_AAD_USER_EMAIL": "<EMAIL_FOR_TEST>"
},
@TsuyoshiUshio
TsuyoshiUshio / private.env
Created October 28, 2019 00:28
Acceptance Testing for debbuging
DEV_ROOT=/Users/ushio/dev/go
GOPATH=/Users/ushio/dev/go
AZDO_ORG_SERVICE_URL="https://dev.azure.com/<YOUR ORGANIZATION>"
AZDO_PERSONAL_ACCESS_TOKEN="<YOUR_AZDO_PERSONAL_ACCESS_TOKEN>"
AZDO_GITHUB_SERVICE_CONNECTION_PAT="<YOUR_GITHUB_SERVICE_CONNECTION>"
AZDO_TEST_AAD_USER_EMAIL=<YOUR_E_MAILS>
TF_ACC=1
@TsuyoshiUshio
TsuyoshiUshio / launch.json
Last active January 14, 2021 19:27
Acceptance Testing Settings
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Acceptance test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/azuredevops/resource_project_test.go",
"args": [