Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
245aec9
start
gearama Nov 5, 2022
f2d0cd2
recording
gearama Nov 10, 2022
5163b4b
playback
gearama Nov 11, 2022
5f167f5
refactor, playback and record
gearama Nov 12, 2022
bd2e83d
recordings for kv
gearama Nov 14, 2022
e909d0d
klklk
gearama Nov 15, 2022
be4d0a5
open telemetry, identity
gearama Nov 16, 2022
6be1746
Merge branch 'main' of https://github.com/gearama/azure-sdk-for-cpp i…
gearama Nov 16, 2022
5fd600d
attest
gearama Nov 17, 2022
0344c18
all tests recorded except storage
gearama Nov 17, 2022
500ad06
STORAGE RECORDINGDS
gearama Nov 18, 2022
e0652d7
some cleanup
gearama Nov 18, 2022
5f07669
ignore result
gearama Nov 18, 2022
5663316
testproxy remade
gearama Nov 19, 2022
c6e4a2c
fiiine , do something with the result , goooosh
gearama Nov 19, 2022
fde3e1b
install test proxy
gearama Nov 19, 2022
a011460
clang
gearama Nov 19, 2022
ef62335
clang
gearama Nov 19, 2022
0021327
certs maybe
gearama Nov 19, 2022
4325d38
cmake generate fix,
gearama Nov 21, 2022
22b2701
start test proxy script
gearama Nov 21, 2022
eb064bb
start test proxy on env
gearama Nov 21, 2022
948a0dc
clang, move TP after build
gearama Nov 21, 2022
308a9df
reregen
gearama Nov 21, 2022
692b885
certs
gearama Nov 22, 2022
3c77e25
sda
gearama Nov 22, 2022
0974890
dss
gearama Nov 22, 2022
113a74b
allow insecure connections
gearama Nov 22, 2022
2869888
put back
gearama Nov 22, 2022
df70807
debug
gearama Nov 22, 2022
64f0afb
iuy
gearama Nov 22, 2022
3f85098
try again
gearama Nov 22, 2022
cb298cf
ewew
gearama Nov 22, 2022
b2082d9
chmod
gearama Nov 22, 2022
edd1226
try again
gearama Nov 22, 2022
9c680f9
update sanitizer
gearama Nov 22, 2022
5784894
output testproxy log
gearama Nov 22, 2022
f04d41c
sjhgasjgdajh
gearama Nov 22, 2022
7b16d59
folder
gearama Nov 22, 2022
6ca954e
worxy
gearama Nov 22, 2022
04c8763
fix tests and log file
gearama Nov 23, 2022
71321c2
format files
gearama Nov 23, 2022
58ceb2c
clang format
gearama Nov 23, 2022
11a91b2
clang
gearama Nov 23, 2022
32b32e1
sa
gearama Nov 23, 2022
3913411
sa
gearama Nov 23, 2022
e8a6aef
cleanup
gearama Nov 23, 2022
25cfe67
cspell
gearama Nov 23, 2022
7a6a0a9
oops
gearama Nov 24, 2022
6b1058a
remove redundant method
gearama Nov 30, 2022
e4fab9f
tests
gearama Nov 30, 2022
2aae9c3
put back original
gearama Nov 30, 2022
41a51e3
restore to 933486385a54a5a09a7444dbd823425f145ad75a
gearama Nov 30, 2022
0daeda7
recordings
gearama Nov 30, 2022
96af696
remove storage values
gearama Nov 30, 2022
0e3731b
storage recordings
gearama Dec 1, 2022
97c81a5
disable non functioning tests
gearama Dec 1, 2022
526569e
remove core install of test proxy
gearama Dec 1, 2022
efbaeec
Merge branch 'main' of https://github.com/gearama/azure-sdk-for-cpp i…
gearama Dec 1, 2022
ed388ff
_LIVEONLY_ tests
gearama Dec 1, 2022
974b71b
clang install when needed
gearama Dec 1, 2022
992e3d0
logs on condition
gearama Dec 1, 2022
3c5374a
skip tests
gearama Dec 1, 2022
69de764
revert cpp to original version
gearama Dec 1, 2022
2598557
quick test
gearama Dec 1, 2022
89c3164
right that one
gearama Dec 1, 2022
a458b33
one skip
gearama Dec 2, 2022
db2d607
identity pushed
gearama Dec 2, 2022
32af793
maybe
gearama Dec 2, 2022
ed8dcb8
override
gearama Dec 2, 2022
2776e75
clang
gearama Dec 2, 2022
b9f15d2
clang
gearama Dec 2, 2022
84d5cb7
attestetion
gearama Dec 2, 2022
a89fc6b
keyvault
gearama Dec 2, 2022
c0044fc
reenable 20+ tests
gearama Dec 5, 2022
d5552b8
5 tests left , lease related
gearama Dec 5, 2022
ad3c323
a bit of cleanup
gearama Dec 5, 2022
85512b4
try now
gearama Dec 5, 2022
f2aaa54
snitizers
gearama Dec 6, 2022
b0b5a71
some fixes
gearama Dec 6, 2022
5cd93b3
capitalization
gearama Dec 6, 2022
3bf64b1
clang , cover, peakA
gearama Dec 6, 2022
85832dc
WEIRD NAME THING ON WINDOWS
gearama Dec 6, 2022
4970b93
storage recordings
gearama Dec 6, 2022
6a3f69d
one more livee
gearama Dec 6, 2022
3db489f
createappenddelete_liveonly
gearama Dec 6, 2022
be1bd3d
CreateWithTags_LIVEONLY_
gearama Dec 6, 2022
a2b9b0d
try capitalization
gearama Dec 6, 2022
97cf514
another onw
gearama Dec 6, 2022
b9a5aa6
maybe now
gearama Dec 6, 2022
6c5a735
all liveonly
gearama Dec 6, 2022
0c5266f
try restore before test
gearama Dec 6, 2022
fbed1e0
typo
gearama Dec 6, 2022
e71848c
condition
gearama Dec 6, 2022
aa87c77
clang and cc
gearama Dec 6, 2022
8d52e19
azure core ci
gearama Dec 6, 2022
1ef452e
qwqwq
gearama Dec 6, 2022
ba46d2d
dsasdas
gearama Dec 6, 2022
873e6eb
cleanup1
gearama Dec 7, 2022
05146fd
typo
gearama Dec 7, 2022
e2faf50
spaces
gearama Dec 7, 2022
549c7d4
cleanup2
gearama Dec 7, 2022
1f028af
cleanup 3
gearama Dec 7, 2022
0f99f96
remove start proxy
gearama Dec 7, 2022
cbe62cb
cleanup +1
gearama Dec 7, 2022
d4460d3
Update cmake-modules/TestProxyPrep.cmake
gearama Dec 12, 2022
f348c3c
Update eng/scripts/Start-TestProxy.ps1
gearama Dec 12, 2022
92db77d
Update eng/scripts/Stop-TestProxy.ps1
gearama Dec 12, 2022
3e7d948
PR comments
gearama Dec 12, 2022
f014d44
clangs
gearama Dec 12, 2022
bcdef12
Update sdk/core/azure-core-test/src/test_proxy_policy.cpp
RickWinter Dec 13, 2022
458d14f
build
gearama Dec 13, 2022
5e2f036
Merge branch 'testProxy' of https://github.com/gearama/azure-sdk-for-…
gearama Dec 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions cmake-modules/TestProxyPrep.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT
#

macro(CopyTestProxyScripts)
file(COPY ${CMAKE_SOURCE_DIR}/eng/Scripts/Start-TestProxy.ps1
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/eng/Scripts/Stop-TestProxy.ps1
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endmacro()
20 changes: 20 additions & 0 deletions eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,21 @@ jobs:
VcpkgArgs: "$(VcpkgArgs)"
Env: "$(CmakeEnvArg)"

- template: /eng/common/testproxy/test-proxy-tool.yml
parameters:
runProxy: true
rootFolder: '$(Build.SourcesDirectory)/sdk/${{parameters.ServiceDirectory}}'
templateFolder: '$(Build.SourcesDirectory)/sdk/${{parameters.ServiceDirectory}}'
condition: and(succeeded(), contains(variables.CmakeArgs, 'BUILD_TESTING=ON'))

- ${{ parameters.PreTestSteps }}

- pwsh: |
test-proxy restore -a $(Build.SourcesDirectory)/sdk/${{parameters.ServiceDirectory}}
workingDirectory: '$(Build.SourcesDirectory)/sdk/${{parameters.ServiceDirectory}}'
displayName: Restore Recordings
condition: and(succeeded(), contains(variables.CmakeArgs, 'BUILD_TESTING=ON'), ne('${{parameters.ServiceDirectory}}', 'core'))

- pwsh: |
ctest `
-C Debug `
Expand All @@ -161,6 +174,13 @@ jobs:
displayName: Test

- ${{ parameters.PostTestSteps }}

- pwsh: |
get-content test-proxy.log
displayName: TestProxy Log
condition: and(succeededOrFailed(), contains(variables.CmakeArgs, 'BUILD_TESTING=ON'))
workingDirectory: $(Build.SourcesDirectory)
continueOnError: true

- task: PublishTestResults@2
inputs:
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/templates/jobs/live.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ jobs:
Location: ${{ coalesce(parameters.Location, parameters.CloudConfig.Location) }}
SubscriptionConfiguration: $(SubscriptionConfiguration)

- template: /eng/common/testproxy/test-proxy-tool.yml
parameters:
runProxy: false

- ${{ parameters.PreTestSteps }}

# For non multi-config generator use the same build configuration to run tests
Expand Down
42 changes: 42 additions & 0 deletions eng/scripts/Start-TestProxy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT

param(
[Parameter(Mandatory=$True)]
[string] $AssetsPath
)
# check is there is another test-proxy running
$running = Get-Process -Name test-proxy
echo $AssetsPath
if($running)
{
echo "test-proxy running, no need for new instance"
exit 0
}

# make sure errors collection is empty
$error.clear()

#check if we have a test-proxy available
$CurrentVersion = (Get-Command -Name "test-proxy" -ErrorAction SilentlyContinue).Version

if($error){
echo "Will install testproxy"

dotnet tool update azure.sdk.tools.testproxy --global --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --version "1.0.0-dev*"
# clear the errors again
$error.clear()

#check again for test proxy presence
$CurrentVersion = (Get-Command -Name "test-proxy" -ErrorAction SilentlyContinue).Version

# if we have errors this means we had issues installing it , needs to be done by hand
if($error){
echo "Unable to install testproxy. Try installing manually."
exit 1
}
}

echo "Start test proxy with argument list --storage-location $AssetsPath"
#starts it in a separate process that will outlive pwsh in order to serve requests.
Start-Process 'test-proxy' -ArgumentList "--storage-location $AssetsPath"
4 changes: 4 additions & 0 deletions eng/scripts/Stop-TestProxy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT

Stop-Process -Name "test-proxy"
6 changes: 6 additions & 0 deletions sdk/attestation/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "cpp",
"TagPrefix": "cpp/attestation",
"Tag": "cpp/attestation_b384d96f95"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this tag mean and where does this suffix b384d96f95 come from?

Copy link
Contributor Author

@gearama gearama Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is autogenerated by the test proxy on upload , not to be manually edited, will be updated on next upload.
The test proxy uses tags/releases to keep track of files and versions, that is a git sha

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that documented somewhere? Please share a link, and we may want to add that as a comment, on in a readme in a file close to/related to the test proxy ones, in this repo.

}
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ namespace Azure { namespace Security { namespace Attestation { namespace Test {
std::string GetTestName(testing::TestParamInfo<PolicyTests::ParamType> const& testInfo)
{
std::string testName;
int suffixVotes = 0;
switch (testInfo.param.TestType)
{
case TestCaseType::GetPolicy:
Expand All @@ -415,6 +416,7 @@ namespace Azure { namespace Security { namespace Attestation { namespace Test {
break;
case TestCaseType::ModifyPolicySecured:
testName += "ModifyGeneratedKey";
suffixVotes++;
break;
case TestCaseType::ModifyPolicyUnsecured:
testName += "ModifyUnsecured";
Expand All @@ -427,6 +429,7 @@ namespace Azure { namespace Security { namespace Attestation { namespace Test {
{
case ServiceInstanceType::AAD:
testName += "AAD";
suffixVotes++;
break;
case ServiceInstanceType::Isolated:
testName += "Isolated";
Expand All @@ -440,6 +443,11 @@ namespace Azure { namespace Security { namespace Attestation { namespace Test {

testName += "_";
testName += testInfo.param.TeeType.ToString();
if (suffixVotes == 2)
{
testName += "_LIVEONLY_";
};
//+"_LIVEONLY_";
return testName;
}
} // namespace
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace Azure { namespace Security { namespace Attestation { namespace Test {
protected:
std::shared_ptr<Azure::Core::Credentials::TokenCredential> m_credential;
std::unique_ptr<AttestationAdministrationClient> m_adminClient;

// Create
virtual void SetUp() override
{
Expand Down
11 changes: 4 additions & 7 deletions sdk/core/azure-core-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,18 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)

set(
AZURE_CORE_TEST_HEADER
inc/azure/core/test/interceptor_manager.hpp
inc/azure/core/test/network_models.hpp
inc/azure/core/test/playback_http_client.hpp
inc/azure/core/test/record_network_call_policy.hpp
inc/azure/core/test/test_base.hpp
inc/azure/core/test/test_context_manager.hpp
inc/azure/core/test/test_proxy_manager.hpp
)

set(
AZURE_CORE_TEST_SOURCE
src/private/package_version.hpp
src/interceptor_manager.cpp
src/playback_http_transport.cpp
src/record_policy.cpp
src/test_proxy_policy.cpp
src/test_base.cpp
src/test_proxy_manager.cpp
)

add_library (
Expand All @@ -46,4 +43,4 @@ target_include_directories (azure-core-test-fw
# make sure that users can consume the project as a library.
add_library (Azure::Core::Test ALIAS azure-core-test-fw)
target_link_libraries(azure-core-test-fw PRIVATE azure-core Azure::azure-identity gtest)
create_map_file(azure-core-test-fw azure-core-test-fw.map)
create_map_file(azure-core-test-fw azure-core-test-fw.map)
1 change: 1 addition & 0 deletions sdk/core/azure-core-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ Azure SDK for C++ is licensed under the [MIT](https://github.com/Azure/azure-sdk
[c_compiler]: https://visualstudio.microsoft.com/vs/features/cplusplus/
[cloud_shell]: https://docs.microsoft.com/azure/cloud-shell/overview
[cloud_shell_bash]: https://shell.azure.com/bash

160 changes: 0 additions & 160 deletions sdk/core/azure-core-test/inc/azure/core/test/interceptor_manager.hpp

This file was deleted.

Loading