Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c5d3414
use new platformatic kafka lib for ctst
SylvainSenechal Mar 11, 2026
849aaee
replace kafkajs library with platformatic kafka
SylvainSenechal Mar 11, 2026
fb4e81e
remove node gyp following removal of node rd kafka
SylvainSenechal Mar 11, 2026
d0fb059
remove useless tools previously used for node rd kafka in ctst docker…
SylvainSenechal Mar 11, 2026
9f9495c
bump cucumber to 12.7
SylvainSenechal Mar 11, 2026
44e2bf5
bump node image to 24 in ctst dockerfile following cucumber bump to 1…
SylvainSenechal Mar 11, 2026
3d50cfa
bump kubernetes client to 1.4.0
SylvainSenechal Mar 11, 2026
33081dd
bump cli-testing to 1.3.0
SylvainSenechal Mar 11, 2026
e5225c0
seed keycloak from cli testing before all following 1.3.0 bump
SylvainSenechal Mar 11, 2026
19a37e3
update cucumber formatter
SylvainSenechal Mar 11, 2026
1665367
fix infinite loop on verify object location
SylvainSenechal Mar 11, 2026
b768dbc
fix 403 auth check
SylvainSenechal Mar 11, 2026
eef65ad
add missing cold storage tag to test
SylvainSenechal Mar 11, 2026
e5bc301
pin azure core client following issues with mismatched azure client l…
SylvainSenechal Mar 11, 2026
16eb2e9
increase sorbetclt limit to 10000 from default 100, as it was found t…
SylvainSenechal Mar 11, 2026
2ae474b
increase notification test reliability by checking for kafka connecto…
SylvainSenechal Mar 11, 2026
bd560f2
remove useless azure archive test
SylvainSenechal Mar 11, 2026
c9c9552
improve uniqueness of object names in tests to avoid collision and im…
SylvainSenechal Mar 11, 2026
dedf6c3
add cucumber extension to codespace
SylvainSenechal Mar 11, 2026
ed16eac
Add CI check for unused Cucumber step definitions
delthas Mar 12, 2026
56d1c1a
Remove unused Cucumber step definitions
delthas Mar 12, 2026
e86395e
Inline unused-steps check and drop --parallel 1
delthas Mar 13, 2026
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
12 changes: 11 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,17 @@
"vscode": {
"extensions": [
"ms-kubernetes-tools.vscode-kubernetes-tools",
]
"cucumberopen.cucumber-official"
],
"settings": {
"cucumber.glue": [
"tests/ctst/steps/**/*.ts",
"tests/ctst/common/**/*.ts"
],
"cucumber.features": [
"tests/ctst/features/**/*.feature"
]
}
}
},
"containerEnv": {
Expand Down
16 changes: 9 additions & 7 deletions .github/scripts/end2end/run-e2e-ctst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ E2E_IMAGE=$E2E_CTST_IMAGE_NAME:$E2E_IMAGE_TAG
POD_NAME="${ZENKO_NAME}-ctst-tests"
CTST_VERSION=$(sed 's/.*"cli-testing": ".*#\(.*\)".*/\1/;t;d' ../../../tests/ctst/package.json)

# Configure keycloak
docker run \
--rm \
--network=host \
"${E2E_IMAGE}" /bin/bash \
-c "SUBDOMAIN=${SUBDOMAIN} CONTROL_PLANE_INGRESS_ENDPOINT=${OIDC_ENDPOINT} ACCOUNT=${ZENKO_ACCOUNT_NAME} KEYCLOAK_REALM=${KEYCLOAK_TEST_REALM_NAME} STORAGE_MANAGER=${STORAGE_MANAGER_USER_NAME} STORAGE_ACCOUNT_OWNER=${STORAGE_ACCOUNT_OWNER_USER_NAME} DATA_CONSUMER=${DATA_CONSUMER_USER_NAME} DATA_ACCESSOR=${DATA_ACCESSOR_USER_NAME} /ctst/node_modules/cli-testing/bin/seedKeycloak.sh"; [[ $? -eq 1 ]] && exit 1 || echo 'Keycloak Configured!'

# Grant access to Kube API (insecure, only for testing)
kubectl create clusterrolebinding serviceaccounts-cluster-admin \
--clusterrole=cluster-admin \
Expand All @@ -178,6 +171,14 @@ kubectl run $POD_NAME \
--attach=True \
--image-pull-policy=IfNotPresent \
--env=TARGET_VERSION=$VERSION \
--env=ACCOUNT=${ZENKO_ACCOUNT_NAME} \
--env=STORAGE_MANAGER=${STORAGE_MANAGER_USER_NAME} \
--env=STORAGE_ACCOUNT_OWNER=${STORAGE_ACCOUNT_OWNER_USER_NAME} \
--env=DATA_CONSUMER=${DATA_CONSUMER_USER_NAME} \
--env=DATA_ACCESSOR=${DATA_ACCESSOR_USER_NAME} \
--env=SEED_KEYCLOAK_DEFAULT_ROLES=true \
--env=KEYCLOAK_HOST=${KEYCLOAK_TEST_HOST} \
--env=KEYCLOAK_REALM=${KEYCLOAK_TEST_REALM_NAME} \
--env=AZURE_BLOB_URL=$AZURE_BACKEND_ENDPOINT \
--env=AZURE_QUEUE_URL=$AZURE_BACKEND_QUEUE_ENDPOINT \
--env=VERBOSE=1 \
Expand Down Expand Up @@ -226,5 +227,6 @@ kubectl run $POD_NAME \
--parallel $PARALLEL_RUNS \
--retry 3 \
--retry-tag-filter @Flaky \
--format pretty \
--format junit:/reports/ctst-junit.xml \
--format html:/reports/report.html
3 changes: 3 additions & 0 deletions .github/workflows/end2end.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ jobs:
- name: Lint ctst tests
working-directory: tests/ctst
run: yarn lint
- name: Check for unused step definitions
working-directory: tests/ctst
run: yarn unused-steps
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Registry
Expand Down
9 changes: 1 addition & 8 deletions tests/ctst/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG DRCTL_TAG=latest
FROM ghcr.io/scality/sorbet:$SORBET_TAG AS sorbet
FROM ghcr.io/scality/zenko-drctl:$DRCTL_TAG AS drctl

FROM node:22.19.0-bookworm-slim
FROM node:24-bookworm-slim

ARG AWSCLI_VERSION=2.17.39

Expand All @@ -18,19 +18,12 @@ WORKDIR /ctst
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-utils \
python3 \
build-essential \
ssh \
git \
curl \
unzip \
jq \
ca-certificates \
librdkafka-dev \
zlib1g-dev \
libssl-dev \
libffi-dev \
libzstd-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

Expand Down
42 changes: 27 additions & 15 deletions tests/ctst/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CacheHelper, Constants, Identity, IdentityEnum, S3, Utils } from 'cli-t
import Zenko from 'world/Zenko';
import { safeJsonParse } from './utils';
import assert from 'assert';
import { Admin, Kafka } from 'kafkajs';
import { Admin } from '@platformatic/kafka';
import {
createBucketWithConfiguration,
putMpuObject,
Expand Down Expand Up @@ -99,17 +99,29 @@ async function addUserMetadataToObject(this: Zenko, objectName: string | undefin
async function getTopicsOffsets(topics: string[], kafkaAdmin: Admin) {
const offsets = [];
for (const topic of topics) {
const partitions: ({ high: string; low: string; })[] =
await kafkaAdmin.fetchTopicOffsets(topic);
const metadata = await kafkaAdmin.metadata({ topics: [topic] });
const partitionCount = metadata.topics.get(topic)?.partitionsCount ?? 0;
const partitionIndexes = Array.from({ length: partitionCount }, (_, i) => ({
partitionIndex: i,
timestamp: BigInt(-2),
}));
const earliestResult = await kafkaAdmin.listOffsets({
topics: [{ name: topic, partitions: partitionIndexes }],
});
const latestResult = await kafkaAdmin.listOffsets({
topics: [{ name: topic, partitions: partitionIndexes.map(p => ({ ...p, timestamp: BigInt(-1) })) }],
});
const partitions = [];
for (let i = 0; i < partitionCount; i++) {
const low = earliestResult[0]?.partitions.find(p => p.partitionIndex === i)?.offset ?? BigInt(0);
const high = latestResult[0]?.partitions.find(p => p.partitionIndex === i)?.offset ?? BigInt(0);
partitions.push({ low: String(low), high: String(high) });
}
offsets.push({ topic, partitions });
}
return offsets;
}

Given('an account', async function (this: Zenko) {
await this.createAccount();
});

async function createBucket(world: Zenko, versioning: string, bucketName: string) {
world.resetCommand();
world.addToSaved('bucketName', bucketName);
Expand Down Expand Up @@ -184,12 +196,6 @@ Given('{int} objects {string} of size {int} bytes with user metadata {string}',
assert.ifError(result?.stderr || result?.err);
});

Given('{int} mpu objects {string} of size {int} bytes with user metadata {string}',
async function (this: Zenko, numberObjects: number, objectName: string, sizeBytes: number, userMD: string) {
const result = await addMultipleObjects.call(this, numberObjects, objectName, sizeBytes, userMD);
assert.ifError(result?.stderr || result?.err);
});

Given('a tag on object {string} with key {string} and value {string}',
async function (this: Zenko, objectName: string, tagKey: string, tagValue: string) {
this.resetCommand();
Expand Down Expand Up @@ -305,10 +311,15 @@ Then('kafka consumed messages should not take too much place on disk', { timeout
assert.fail('Kafka cleaner did not clean the topics within the expected time');
}, checkInterval * 10); // Timeout after 10 Kafka cleaner intervals

const kafkaAdmin = new Admin({
clientId: 'ctst-kafka-cleaner-check',
bootstrapBrokers: [this.parameters.KafkaHosts],
});

try {
const ignoredTopics = ['dead-letter'];
const kafkaAdmin = new Kafka({ brokers: [this.parameters.KafkaHosts] }).admin();
const topics: string[] = (await kafkaAdmin.listTopics())
const allTopics = await kafkaAdmin.listTopics();
const topics: string[] = allTopics
.filter(t => (t.includes(this.parameters.InstanceID) &&
!ignoredTopics.some(e => t.includes(e))));

Expand Down Expand Up @@ -368,6 +379,7 @@ Then('kafka consumed messages should not take too much place on disk', { timeout
assert(topics.length === 0, `Topics ${topics.join(', ')} still have not been cleaned`);
} finally {
clearTimeout(timeoutID);
await kafkaAdmin.close();
}
});

Expand Down
4 changes: 4 additions & 0 deletions tests/ctst/common/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import {
cleanupAccount,
} from './utils';

import 'cli-testing/hooks/KeycloakSetup';
import 'cli-testing/hooks/Logger';
import 'cli-testing/hooks/versionTags';

// HTTPS should not cause any error for CTST
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';

Expand Down
3 changes: 1 addition & 2 deletions tests/ctst/cucumber.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ module.exports = {
require: ['steps/**/*.ts', 'common/**/*.ts', 'world/**/*.ts'],
paths: ['features/**/*.feature'],
format: [
'progress-bar',
'@cucumber/pretty-formatter',
'pretty',
'json:reports/cucumber-report.json',
'html:reports/report.html',
],
Expand Down
Loading
Loading