Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/actions/perform_smoke_test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ runs:
--xcresult-path smoke-test/swift/TestResults.xcresult \
--token ${{ inputs.staging-api-token }} \
--test-process-exit-code $EXIT_CODE \
--test-collection-short-id z2dzjLHm
--test-collection-id z2dzjLHm
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io

Expand All @@ -106,7 +106,7 @@ runs:
--org-url-slug trunk-staging-org \
--junit-paths "${{ github.workspace }}/target/**/*junit.xml" \
--token ${{ inputs.staging-api-token }} \
--test-collection-short-id z2dzjLHm
--test-collection-id z2dzjLHm

- name: Upload to staging with public repo id
id: staging-upload-public-repo-id
Expand Down Expand Up @@ -139,7 +139,7 @@ runs:
--junit-paths "${{ github.workspace }}/target/**/*junit.xml" \
--token ${{ inputs.staging-api-token }} \
--variant smoke-test-variant \
--test-collection-short-id z2dzjLHm
--test-collection-id z2dzjLHm
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "ERROR: Expected upload with variant to fail, but it succeeded"
Expand Down
6 changes: 6 additions & 0 deletions .github/actions/test_ruby_gem_uploads/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ inputs:
platform:
description: The platform that the gem was built for
required: true
test-collection-id:
description: Optional 8 character alphanumeric ID for a test collection
required: false
knapsack-pro-test-suite-token-rspec:
description: Optional Knapsack Pro test suite token for RSpec
required: true
Expand Down Expand Up @@ -83,6 +86,7 @@ runs:
TRUNK_PUBLIC_API_ADDRESS: ${{ inputs.trunk-public-api-address }}
TRUNK_ORG_URL_SLUG: ${{ inputs.trunk-org-slug }}
TRUNK_API_TOKEN: ${{ inputs.trunk-token }}
TRUNK_TEST_COLLECTION_ID: ${{ inputs.test-collection-id }}

- name: Run variant quarantine test without variant (should fail - not quarantined)
id: run-variant-test-no-variant
Expand All @@ -102,6 +106,7 @@ runs:
TRUNK_PUBLIC_API_ADDRESS: ${{ inputs.trunk-public-api-address }}
TRUNK_ORG_URL_SLUG: ${{ inputs.trunk-org-slug }}
TRUNK_API_TOKEN: ${{ inputs.trunk-token }}
TRUNK_TEST_COLLECTION_ID: ${{ inputs.test-collection-id }}
TRUNK_VARIANT: ""

- name: Run variant quarantine test with variant (should pass - quarantined)
Expand All @@ -122,6 +127,7 @@ runs:
TRUNK_PUBLIC_API_ADDRESS: ${{ inputs.trunk-public-api-address }}
TRUNK_ORG_URL_SLUG: ${{ inputs.trunk-org-slug }}
TRUNK_API_TOKEN: ${{ inputs.trunk-token }}
TRUNK_TEST_COLLECTION_ID: ${{ inputs.test-collection-id }}
TRUNK_VARIANT: smoke-test-variant

- name: Run quarantine lookup failure abort test (should fail fast, skip slow_test)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jobs:
--org-url-slug trunk-staging-org \
--token ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} \
--test-process-exit-code ${{ steps.extract.outputs.test-step-outcome }} \
--test-collection-short-id 2tYJWMu7
--test-collection-id 2tYJWMu7

- name: Upload results to prod using built CLI
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_ruby_gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ jobs:
with:
ruby-version: ${{ matrix.ruby-version }}
trunk-token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}
test-collection-id: T5yKSn9h
platform: ${{ matrix.platform.name }}
artifact-pattern: cross-gem-${{ matrix.platform.name }}
knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:
trunk-token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}
trunk-public-api-address: https://api.trunk-staging.io
trunk-org-slug: trunk-staging-org
test-collection-id: T5yKSn9h
platform: x86_64-linux
artifact-pattern: ""
knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }}
2 changes: 2 additions & 0 deletions .github/workflows/smoke_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ jobs:
trunk-token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}
trunk-public-api-address: https://api.trunk-staging.io
trunk-org-slug: trunk-staging-org
test-collection-id: T5yKSn9h
platform: x86_64-linux
artifact-pattern: ""
knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }}
Expand All @@ -198,6 +199,7 @@ jobs:
trunk-token: ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }}
trunk-public-api-address: https://api.trunk.io
trunk-org-slug: trunk
test-collection-id: BiBP2neA
platform: x86_64-linux
artifact-pattern: ""
knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/smoke_test_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ jobs:
trunk-token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}
trunk-public-api-address: https://api.trunk-staging.io
trunk-org-slug: trunk-staging-org
test-collection-id: T5yKSn9h
platform: x86_64-linux
artifact-pattern: ""
knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }}
Expand All @@ -251,6 +252,7 @@ jobs:
trunk-token: ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }}
trunk-public-api-address: https://api.trunk.io
trunk-org-slug: trunk
test-collection-id: BiBP2neA
platform: x86_64-linux
artifact-pattern: ""
knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }}
Expand Down
6 changes: 3 additions & 3 deletions cli/src/upload_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ pub struct UploadArgs {
#[arg(long, env = constants::TRUNK_ORG_URL_SLUG_ENV, help = "Organization url slug.")]
pub org_url_slug: String,
#[arg(
long,
env = constants::TRUNK_TEST_COLLECTION_SHORT_ID_ENV,
help = "Optional test collection short ID to attach to the uploaded bundle for collection-aware ingestion.",
long = "test-collection-id",
env = constants::TRUNK_TEST_COLLECTION_ID_ENV,
help = "Optional 8 character alphanumeric ID for a test collection.",
required = false,
num_args = 1
)]
Expand Down
9 changes: 3 additions & 6 deletions cli/tests/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async fn upload_bundle() {
let assert = command_builder
.command()
.env("GITHUB_EXTERNAL_ID", "test-external-id-123")
.arg("--test-collection-short-id")
.arg("--test-collection-id")
.arg("tc_123")
.assert()
// should fail due to quarantine and succeed without quarantining
Expand Down Expand Up @@ -237,10 +237,7 @@ async fn upload_bundle() {
assert_eq!(test_case_run.codeowners[1].name, "@user2");

let mut expected_command_args = command_builder.build_args();
expected_command_args.extend([
String::from("--test-collection-short-id"),
String::from("tc_123"),
]);
expected_command_args.extend([String::from("--test-collection-id"), String::from("tc_123")]);
assert!(
debug_props.command_line.ends_with(
&expected_command_args
Expand Down Expand Up @@ -530,7 +527,7 @@ async fn upload_bundle_without_canonical_test_collection_metadata_keeps_bundle_g

CommandBuilder::upload(temp_dir.path(), state.host.clone())
.command()
.arg("--test-collection-short-id")
.arg("--test-collection-id")
.arg("tc_123")
.assert()
.failure();
Expand Down
4 changes: 2 additions & 2 deletions constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub const TRUNK_API_CLIENT_RETRY_COUNT_ENV: &str = "TRUNK_API_CLIENT_RETRY_COUNT
pub const TRUNK_API_TOKEN_ENV: &str = "TRUNK_API_TOKEN";
pub const TRUNK_PUBLIC_REPO_ID_ENV: &str = "TRUNK_PUBLIC_REPO_ID";
pub const TRUNK_ORG_URL_SLUG_ENV: &str = "TRUNK_ORG_URL_SLUG";
pub const TRUNK_TEST_COLLECTION_SHORT_ID_ENV: &str = "TRUNK_TEST_COLLECTION_SHORT_ID";
pub const TRUNK_TEST_COLLECTION_ID_ENV: &str = "TRUNK_TEST_COLLECTION_ID";
pub const TRUNK_REPO_ROOT_ENV: &str = "TRUNK_REPO_ROOT";
pub const TRUNK_REPO_URL_ENV: &str = "TRUNK_REPO_URL";
pub const TRUNK_REPO_HEAD_SHA_ENV: &str = "TRUNK_REPO_HEAD_SHA";
Expand Down Expand Up @@ -63,7 +63,7 @@ pub const TRUNK_ENVS_TO_CAPTURE: &[&str] = &[
TRUNK_API_CLIENT_RETRY_COUNT_ENV,
TRUNK_PUBLIC_REPO_ID_ENV,
TRUNK_ORG_URL_SLUG_ENV,
TRUNK_TEST_COLLECTION_SHORT_ID_ENV,
TRUNK_TEST_COLLECTION_ID_ENV,
TRUNK_REPO_ROOT_ENV,
TRUNK_REPO_URL_ENV,
TRUNK_REPO_HEAD_SHA_ENV,
Expand Down
1 change: 1 addition & 0 deletions rspec-trunk-flaky-tests/lib/trunk_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#
# Optional environment variables for configuration:
# TRUNK_CODEOWNERS_PATH - Path to CODEOWNERS file
# TRUNK_TEST_COLLECTION_ID - Optional 8 character alphanumeric ID for a test collection
# TRUNK_VARIANT - Variant name for test results (e.g., 'linux', 'pr-123')
# TRUNK_DISABLE_QUARANTINING - Set to 'true' to disable quarantining
# TRUNK_ALLOW_EMPTY_TEST_RESULTS - Set to 'true' to allow empty results
Expand Down
2 changes: 2 additions & 0 deletions test_report/src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,8 @@ impl MutTestReport {
upload_args.pr_number = env::var(constants::TRUNK_PR_NUMBER_ENV)
.ok()
.and_then(|v| v.parse::<usize>().ok());
upload_args.test_collection_short_id =
env::var(constants::TRUNK_TEST_COLLECTION_ID_ENV).ok();
let debug_props = BundleMetaDebugProps {
command_line: self.0.borrow().command.clone(),
trunk_envs: HashMap::new(),
Expand Down
Loading