Skip to content

Commit 6dff6fa

Browse files
Add end-to-end cloud test workflow with Microsoft Entra ID. (#4841)
This PR adds the foundations for testing connectivity of TileDB to the real clouds by adding a new workflow named `test-cloud-e2e`. Currently only Azure with Microsoft Entra ID authentication is provided. Authentication happens [with OpenID Connect](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure). A new environment was created that has read-only access to the `core` container of the `tiledbci` storage account, and we test that the file `test.txt` in that container exists. The test is configured with environment variables, making it reusable for subsequent tests with other cloud providers. --- TYPE: NO_HISTORY --------- Co-authored-by: Theodore Tsirpanis <[email protected]>
1 parent 86ef4c5 commit 6dff6fa

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed

.github/workflows/test-cloud-e2e.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: End-to-End cloud service tests
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
run_azure:
6+
description: 'Run Azure tests'
7+
required: true
8+
default: true
9+
type: boolean
10+
push:
11+
branches:
12+
- dev
13+
- release-*
14+
15+
env:
16+
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
17+
SCCACHE_GHA_ENABLED: "true"
18+
19+
jobs:
20+
azure:
21+
runs-on: ubuntu-latest
22+
if: inputs.run_azure != 'false'
23+
environment: azure-e2e-test
24+
env:
25+
bootstrap_args: --enable-azure --enable-ccache
26+
permissions:
27+
id-token: write # Get OIDC token for authentication to Azure
28+
name: Azure
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
# Configure required environment variables for vcpkg to use
35+
# GitHub's Action Cache
36+
- uses: actions/github-script@v7
37+
with:
38+
script: |
39+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
40+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
41+
42+
- name: Prevent vpckg from building debug variants
43+
run: python ./scripts/ci/patch_vcpkg_triplets.py
44+
45+
- name: Setup sccache
46+
uses: mozilla-actions/[email protected]
47+
48+
- name: 'Configure libtiledb'
49+
id: configure
50+
shell: bash
51+
run: |
52+
set -e pipefail
53+
54+
# Show CMake Version
55+
cmake --version
56+
57+
source $GITHUB_WORKSPACE/scripts/ci/bootstrap_libtiledb.sh
58+
59+
- name: 'Build libtiledb'
60+
id: build
61+
shell: bash
62+
run: |
63+
set -e pipefail
64+
65+
#####################################################
66+
# Build libtiledb using previous bootstrap
67+
68+
source $GITHUB_WORKSPACE/scripts/ci/build_libtiledb.sh
69+
70+
- name: 'Az CLI login'
71+
uses: azure/login@v2
72+
with:
73+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
74+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
75+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
76+
77+
- name: 'Test libtiledb'
78+
id: test
79+
shell: bash
80+
env:
81+
# Allow forks to specify different values.
82+
AZURE_STORAGE_ACCOUNT: ${{ vars.AZURE_STORAGE_ACCOUNT || 'tiledbci' }}
83+
TILEDB_VFS_E2E_TEST_FILE: ${{ vars.AZURE_E2E_TEST_FILE || 'azure://tiledb/test.txt' }}
84+
run: |
85+
set -e pipefail
86+
87+
cd $GITHUB_WORKSPACE/build
88+
89+
###################################################
90+
# Run tests
91+
92+
# Bypass Catch2 Framework stdout interception with awk on test output
93+
./tiledb/test/tiledb_unit -d yes "[vfs-e2e]" | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1'
94+
95+
- name: 'Test status check'
96+
run: |
97+
# tiledb_unit is configured to set a variable TILEDB_CI_SUCCESS=1
98+
# following the test run. If this variable is not set, the build should fail.
99+
# see https://github.com/TileDB-Inc/TileDB/pull/1400 (5f0623f4d3)
100+
if [[ "${{ steps.test.outputs.TILEDB_CI_SUCCESS }}" -ne 1 ]]; then
101+
exit 1;
102+
fi
103+
104+
- name: "Print log files (failed build only)"
105+
run: |
106+
source $GITHUB_WORKSPACE/scripts/ci/print_logs.sh
107+
if: ${{ failure() }} # only run this job if the build step failed

test/src/unit-vfs.cc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,26 @@ TEMPLATE_LIST_TEST_CASE("VFS: File I/O", "[vfs][uri][file_io]", AllBackends) {
552552
}
553553
}
554554

555+
TEST_CASE("VFS: Test end-to-end", "[.vfs-e2e]") {
556+
auto test_file_ptr = getenv("TILEDB_VFS_E2E_TEST_FILE");
557+
if (test_file_ptr == nullptr) {
558+
FAIL("TILEDB_VFS_E2E_TEST_FILE variable is not specified");
559+
}
560+
URI test_file{test_file_ptr};
561+
562+
ThreadPool compute_tp(1);
563+
ThreadPool io_tp(1);
564+
// Will be configured from environment variables.
565+
Config config;
566+
567+
VFS vfs{&g_helper_stats, &compute_tp, &io_tp, config};
568+
REQUIRE(vfs.supports_uri_scheme(test_file));
569+
570+
uint64_t nbytes = 0;
571+
require_tiledb_ok(vfs.file_size(test_file, &nbytes));
572+
CHECK(nbytes > 0);
573+
}
574+
555575
TEST_CASE("VFS: test ls_with_sizes", "[vfs][ls-with-sizes]") {
556576
ThreadPool compute_tp(4);
557577
ThreadPool io_tp(4);

0 commit comments

Comments
 (0)