Skip to content
Docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

Code Archives

Using uploaded ZIP archives instead of Git repositories to provide load test suites.

As an alternative to Git-based source code repositories, load testing projects in XTC allow you to upload source code archives (ZIP files). Use this feature if:

  • Your Git repository is not accessible from XTC.
  • You use a source code repository other than Git.

Like Git repositories, a code archive contains the load test suite in source form. When configuring a load test to use a code archive, that archive provides the test suite source code instead of a Git repository. XTC compiles the test suite directly and applies build and dependency caches during execution.

Prerequisites

Ensure that your code archive meets the following requirements:

  • Format: the archive must be in ZIP format.
  • Structure: the ZIP archive must contain a single top-level directory.
  • Sources: the top-level directory must contain the source files of your test suite. This includes all files required to successfully build the test suite (such as Maven’s pom.xml or Gradle’s build.gradle). Exclude version control metadata such as .git directories.

Maven plugin automation

To automate packaging and uploading code archives to XTC, Xceptance provides a dedicated Maven plugin. You can integrate the plugin directly into your test projects to automate packaging and uploading as part of your CI/CD pipeline.

Detailed configuration instructions and setup examples are available in the xtc-maven-plugin repository.

Best practices

When creating a code archive manually or using tools/scripts other than the official plugin, ensure you exclude temporary or generated directories to keep the archive size small. In particular, exclude the following before archiving:

  • Build directories: exclude build output folders like target/ (for Maven) or build/ (for Gradle).
  • Test results: exclude local load test results (typically the results/ directory).
  • SCM metadata: exclude version control folders such as .git/ or .svn/.
  • IDE settings: exclude IDE-specific folders (such as .idea/, .vscode/, or .settings/).

UI management

You can manage code archives directly through the XTC web UI:

  1. Open your project and select Configuration in the left menu.
  2. Click the Code Archives tab.

From here, you can:

  • Upload: drag and drop or browse to upload new ZIP archives.
  • Edit: update archive metadata (such as description) for existing archives.
  • Delete: delete archives that are no longer needed.

Retention and storage limits

To prevent archives from accumulating indefinitely, XTC automatically cleans up old archives on a daily basis:

  • Size limit: the size of a single uploaded code archive cannot exceed 100 MB. Uploads exceeding this limit fail.
  • Archive limit: a project may hold up to 300 code archives. Once reaching this threshold, further uploads fail until you delete older archives.
  • Auto-deletion: archives older than 30 days are eligible for automatic removal. XTC always retains at least the 30 most recent archives regardless of age.
  • Storage quota: code archives count toward your project’s cloud storage usage (alongside load test results and reports).

Integrity checksums

To verify the integrity of your uploads and prevent corruption during transit, XTC maintains checksums for all code archives:

  • UI uploads: when uploading files through the web UI, XTC calculates the SHA-512 checksum locally before transmission begins.
  • API uploads: when uploading via the REST API, you can optionally include a precalculated SHA-512 checksum in the Content-Digest HTTP header. When provided, XTC validates the uploaded file against this digest. If omitted, XTC stores the archive as transmitted.
  • Verification: regardless of how the archive was uploaded, XTC stores and displays its checksum in the code archives list for easy verification and reference.

REST API automation

You can automate the management and upload of code archives using the XTC REST API (for example, as part of a CI/CD pipeline).

1. Create API credentials

Create API client credentials with at least the CODEARCHIVE_UPLOAD and CODEARCHIVE_DELETE scopes in your project configuration (under Configuration > Integrations > API Client Credentials).

2. Request an access token

Use your client credentials to request an OAuth access token:

curl -k -X POST \
     -d "client_id=<your-client-id>" \
     -d "client_secret=<your-client-secret>" \
     -d "grant_type=client_credentials" \
     -d "scope=CODEARCHIVE_UPLOAD CODEARCHIVE_DELETE" \
     https://xtc.xceptance.com/oauth/token

Extract the access_token field from the JSON response.

3. Upload a code archive

Perform the upload by sending the binary data of the ZIP archive. Replace <access-token>, <path/to/archive.zip>, <org>, and <project> with your values:

curl -k -X POST \
     -H "Authorization: Bearer <access-token>" \
     -H "Content-Type: application/zip" \
     --data-binary "@<path/to/archive.zip>" \
     https://xtc.xceptance.com/public/api/v2/orgs/<org>/projects/<project>/code-archives

Optional: to ensure file integrity, pass a precalculated SHA-512 checksum using the Content-Digest header:

curl -k -X POST \
     -H "Authorization: Bearer <access-token>" \
     -H "Content-Type: application/zip" \
     -H "Content-Digest: sha-512=:<your-precalculated-sha512-hash-in-base64>:" \
     --data-binary "@<path/to/archive.zip>" \
     https://xtc.xceptance.com/public/api/v2/orgs/<org>/projects/<project>/code-archives

4. Delete a code archive

To delete an archive programmatically, find its ID from the API Explorer or the UI, and send a DELETE request:

curl -k -X DELETE \
     -H "Authorization: Bearer <access-token>" \
     https://xtc.xceptance.com/public/api/v2/orgs/<org>/projects/<project>/code-archives/<code-archive-id>

For more endpoints and detailed payload definitions, refer to the API Explorer.

Last updated on