Skip to content

feat(libraries): use chainsaw and crossplane as library #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

haarchri
Copy link
Contributor

Description of your changes

  • switch shellout chainsaw to use chainsaw as library
  • switch shellout crossplane to use crossplane beta trace as library
  • fix an issue with kubectl wait

Fixes #

I have:

  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

UPTEST_CLOUD_CREDENTIALS=$(cat ~/.aws/aws.json) UPTEST_EXAMPLE_LIST=examples/kcl/network-xr.yaml make e2e
00:19:03 [ .. ] Generating kcl composition
00:19:03 [ OK ] Generated kcl composition
00:19:04 [ .. ] Building package configuration-aws-network-v0.23.0-7.g57c2d7d.xpkg for linux_arm64
xpkg saved to /Users/haarchri/Documents/uptest/example/configuration-aws-network/_output/xpkg/linux_arm64/configuration-aws-network-v0.23.0-7.g57c2d7d.xpkg
00:19:04 [ OK ] Built package configuration-aws-network-v0.23.0-7.g57c2d7d.xpkg for linux_arm64
00:19:05 [ .. ] deleting controlplane
Deleting cluster "uptest-configuration-aws-network" ...
Deleted nodes: ["uptest-configuration-aws-network-control-plane"]
00:19:05 [ OK ] deleting controlplane
00:19:05 [ .. ] setting up controlplane
Creating cluster "uptest-configuration-aws-network" ...
 ✓ Ensuring node image (kindest/node:v1.30.0) 🖼
 ✓ Preparing nodes 📦  
 ✓ Writing configuration 📜 
 ✓ Starting control-plane 🕹️ 
 ✓ Installing CNI 🔌 
 ✓ Installing StorageClass 💾 
Set kubectl context to "kind-uptest-configuration-aws-network"
You can now use your cluster with:

kubectl cluster-info --context kind-uptest-configuration-aws-network

Not sure what to do next? 😅  Check out https://kind.sigs.k8s.io/docs/user/quick-start/
00:19:19 [ .. ] setting kubectl context to kind-uptest-configuration-aws-network
Switched to context "kind-uptest-configuration-aws-network".
"crossplane-build-module" has been added to your repositories
Hang tight while we grab the latest from your chart repositories...
Update Complete. ⎈Happy Helming!⎈
00:19:22 [ .. ] setting up crossplane core with args --enable-usages
NAME: crossplane
LAST DEPLOYED: Sat Mar 15 00:19:23 2025
NAMESPACE: upbound-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
By proceeding, you are accepting to comply with terms and conditions in https://licenses.upbound.io/upbound-software-license.html

✨ Thank you for installing Universal Crossplane!
🚀 Install packages from https://marketplace.upbound.io to get started!
00:19:23 [ .. ] patching Crossplane with dev sidecar
deployment.apps/crossplane patched
deployment.apps/crossplane condition met
pod/crossplane-6ff649df6-vf9rf condition met
00:19:47 [ OK ] patching Crossplane with dev sidecar
00:19:47 [ .. ] copying local xpkg cache to Crossplane pod
xpkg contents extracted to /Users/haarchri/Documents/uptest/example/configuration-aws-network/_output/xpkg/cache/configuration-aws-network-v0.23.0-7.g57c2d7d.gz
00:19:48 [ OK ] copying local xpkg cache to Crossplane pod
00:19:48 [ .. ] deploying configuration package configuration-aws-network v0.23.0-7.g57c2d7d
configuration.pkg.crossplane.io/configuration-aws-network created
00:19:48 [ OK ] deploying configuration package configuration-aws-network v0.23.0-7.g57c2d7d
00:19:48 [ .. ] running automated tests
SKIP_DEPLOY_ARGO= KUBECTL=/Users/haarchri/Documents/uptest/example/configuration-aws-network/.cache/tools/darwin_arm64/kubectl-v1.24.3 CROSSPLANE_NAMESPACE=upbound-system YQ=/Users/haarchri/Documents/uptest/example/configuration-aws-network/.cache/tools/darwin_arm64/yq-v4.40.5 /Users/haarchri/Documents/uptest/example/configuration-aws-network/.cache/tools/darwin_arm64/uptest-v1.2.0 e2e examples/kcl/network-xr.yaml --data-source="" --setup-script=test/setup.sh  --skip-update --default-timeout=2400s || (echo `date +%H:%M:%S` [FAIL] && false)
2025/03/15 00:19:50 Skipping update step because the root resource does not exist
2025/03/15 00:19:50 Skipping update step because the skip-delete option is set to true
2025/03/15 00:19:50 Written test files: /var/folders/ym/wqrhc4wd0mj6b1wbkc25s0_80000gn/T/uptest-e2e
2025/03/15 00:19:50 Running chainsaw tests at /var/folders/ym/wqrhc4wd0mj6b1wbkc25s0_80000gn/T/uptest-e2e
2025/03/15 00:19:50 Loading default configuration...
2025/03/15 00:19:50 - Using test file: 00-apply.yaml
2025/03/15 00:19:50 - ApplyTimeout 5s
2025/03/15 00:19:50 - AssertTimeout 30s
2025/03/15 00:19:50 - CleanupTimeout 30s
2025/03/15 00:19:50 - DeleteTimeout 15s
2025/03/15 00:19:50 - ErrorTimeout 30s
2025/03/15 00:19:50 - ExecTimeout 5s
2025/03/15 00:19:50 - Parallel 1
2025/03/15 00:19:50 Loading tests...
2025/03/15 00:19:50 - apply (/var/folders/ym/wqrhc4wd0mj6b1wbkc25s0_80000gn/T/uptest-e2e/case)
2025/03/15 00:19:50 Running tests...
=== RUN   chainsaw
=== PAUSE chainsaw
=== CONT  chainsaw
=== RUN   chainsaw/apply
=== PAUSE chainsaw/apply
=== CONT  chainsaw/apply
    | 00:19:50 | apply | @chainsaw                | CREATE    | OK    | v1/Namespace @ chainsaw-dominant-lemur
    | 00:19:50 | apply | Run Setup Script         | TRY       | BEGIN |
    | 00:19:50 | apply | Run Setup Script         | CMD       | RUN   |
        === COMMAND
        /Users/haarchri/Documents/uptest/example/configuration-aws-network/test/setup.sh
    | 00:20:40 | apply | Run Setup Script         | CMD       | LOG   |
        === STDOUT
        Running setup.sh
        Waiting until configuration package is healthy/installed...
        configuration.pkg.crossplane.io/configuration-aws-network condition met
        configuration.pkg.crossplane.io/configuration-aws-network condition met
        Creating cloud credential secret...
        secret/aws-creds created
        Waiting until all installed provider packages are healthy...
        provider.pkg.crossplane.io/upbound-provider-aws-ec2 condition met
        provider.pkg.crossplane.io/upbound-provider-family-aws condition met
        Waiting until all installed function packages are healthy...
        function.pkg.crossplane.io/crossplane-contrib-function-auto-ready condition met
        function.pkg.crossplane.io/crossplane-contrib-function-go-templating condition met
        function.pkg.crossplane.io/crossplane-contrib-function-kcl condition met
        Waiting for all pods to come online...
        deployment.apps/crossplane condition met
        deployment.apps/crossplane-contrib-function-auto-ready-8c07a9434f50 condition met
        deployment.apps/crossplane-contrib-function-go-templating-3fc997d6b713 condition met
        deployment.apps/crossplane-contrib-function-kcl-75af757c6af6 condition met
        deployment.apps/crossplane-rbac-manager condition met
        deployment.apps/upbound-provider-aws-ec2-21aa53711e54 condition met
        deployment.apps/upbound-provider-family-aws-20202ddbd61a condition met
        Waiting for all XRDs to be established...
        compositeresourcedefinition.apiextensions.crossplane.io/xnetworks.aws.platform.upbound.io condition met
        Creating a default provider config...
        providerconfig.aws.upbound.io/default created
    | 00:20:40 | apply | Run Setup Script         | CMD       | DONE  |
    | 00:20:40 | apply | Run Setup Script         | TRY       | END   |
    | 00:20:40 | apply | Apply Resources          | TRY       | BEGIN |
    | 00:20:40 | apply | Apply Resources          | APPLY     | RUN   | aws.platform.upbound.io/v1alpha1/XNetwork @ configuration-aws-network-kcl
    | 00:20:40 | apply | Apply Resources          | CREATE    | OK    | aws.platform.upbound.io/v1alpha1/XNetwork @ configuration-aws-network-kcl
    | 00:20:40 | apply | Apply Resources          | APPLY     | DONE  | aws.platform.upbound.io/v1alpha1/XNetwork @ configuration-aws-network-kcl
    | 00:20:40 | apply | Apply Resources          | CMD       | RUN   |
        === COMMAND
        /bin/sh -c echo "Runnning annotation script"
        ${KUBECTL} annotate xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl upjet.upbound.io/test=true --overwrite
    | 00:20:40 | apply | Apply Resources          | SCRIPT    | LOG   |
        === STDOUT
        Runnning annotation script
        xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl annotated
    | 00:20:40 | apply | Apply Resources          | SCRIPT    | DONE  |
    | 00:20:40 | apply | Apply Resources          | TRY       | END   |
    | 00:20:40 | apply | Assert Status Conditions | TRY       | BEGIN |
    | 00:20:40 | apply | Assert Status Conditions | ASSERT    | RUN   | aws.platform.upbound.io/v1alpha1/XNetwork @ configuration-aws-network-kcl
NAME                                                               RESOURCE                                     SYNCED   READY   STATUS
XNetwork/configuration-aws-network-kcl                                                                          True     False   Creating: Unready resources: igw, mrt, route, and 13 more
├─ InternetGateway/configuration-aws-network-kcl-ztq6x             igw                                          False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.VPCID: referenced field was empty (referenced resource may not yet be ready)
├─ MainRouteTableAssociation/configuration-aws-network-kcl-dztdk   mrt                                          False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.RouteTableID: referenced field was empty (referenced resource may not yet be ready)
├─ RouteTableAssociation/configuration-aws-network-kcl-4flcm       rta-us-west-2b-192-168-64-0-18-public        False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.RouteTableID: referenced field was empty (referenced resource may not yet be ready)
├─ RouteTableAssociation/configuration-aws-network-kcl-6zh6w       rta-us-west-2a-192-168-128-0-18-private      False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.RouteTableID: referenced field was empty (referenced resource may not yet be ready)
├─ RouteTableAssociation/configuration-aws-network-kcl-kmwt2       rta-us-west-2b-192-168-192-0-18-private      False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.RouteTableID: referenced field was empty (referenced resource may not yet be ready)
├─ RouteTableAssociation/configuration-aws-network-kcl-mgx75       rta-us-west-2a-192-168-0-0-18-public         False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.RouteTableID: referenced field was empty (referenced resource may not yet be ready)
├─ RouteTable/configuration-aws-network-kcl-tcpg5                  rt                                           False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.VPCID: referenced field was empty (referenced resource may not yet be ready)
├─ Route/configuration-aws-network-kcl-xj7hz                       route                                        False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.GatewayID: referenced field was empty (referenced resource may not yet be ready)
├─ SecurityGroupRule/configuration-aws-network-kcl-gmdbl           sgr-mysql                                    False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.SecurityGroupID: referenced field was empty (referenced resource may not yet be ready)
├─ SecurityGroupRule/configuration-aws-network-kcl-qvxwq           sgr-postgres                                 False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.SecurityGroupID: referenced field was empty (referenced resource may not yet be ready)
├─ SecurityGroup/configuration-aws-network-kcl-z957b               sg                                           False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.VPCID: referenced field was empty (referenced resource may not yet be ready)
├─ Subnet/configuration-aws-network-kcl-lwpn7                      subnet-us-west-2b-192-168-64-0-18-public     False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.VPCID: referenced field was empty (referenced resource may not yet be ready)
├─ Subnet/configuration-aws-network-kcl-vcf7r                      subnet-us-west-2a-192-168-128-0-18-private   False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.VPCID: referenced field was empty (referenced resource may not yet be ready)
├─ Subnet/configuration-aws-network-kcl-vswkk                      subnet-us-west-2b-192-168-192-0-18-private   False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.VPCID: referenced field was empty (referenced resource may not yet be ready)
├─ Subnet/configuration-aws-network-kcl-wwgf9                      subnet-us-west-2a-192-168-0-0-18-public      False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.VPCID: referenced field was empty (referenced resource may not yet be ready)
└─ VPC/configuration-aws-network-kcl-hxd6l                         vpc                                          True     False   Creating
NAME                                                               RESOURCE                                     SYNCED   READY   STATUS
XNetwork/configuration-aws-network-kcl                                                                          True     False   Creating: Unready resources: igw, mrt, route, and 12 more
├─ InternetGateway/configuration-aws-network-kcl-ztq6x             igw                                          True     True    Available
├─ MainRouteTableAssociation/configuration-aws-network-kcl-dztdk   mrt                                          False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.RouteTableID: referenced field was empty (referenced resource may not yet be ready)
├─ RouteTableAssociation/configuration-aws-network-kcl-4flcm       rta-us-west-2b-192-168-64-0-18-public        False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.RouteTableID: referenced field was empty (referenced resource may not yet be ready)
├─ RouteTableAssociation/configuration-aws-network-kcl-6zh6w       rta-us-west-2a-192-168-128-0-18-private      False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.RouteTableID: referenced field was empty (referenced resource may not yet be ready)
├─ RouteTableAssociation/configuration-aws-network-kcl-kmwt2       rta-us-west-2b-192-168-192-0-18-private      False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.RouteTableID: referenced field was empty (referenced resource may not yet be ready)
├─ RouteTableAssociation/configuration-aws-network-kcl-mgx75       rta-us-west-2a-192-168-0-0-18-public         False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.RouteTableID: referenced field was empty (referenced resource may not yet be ready)
├─ RouteTable/configuration-aws-network-kcl-tcpg5                  rt                                           True     False   Creating
├─ Route/configuration-aws-network-kcl-xj7hz                       route                                        False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.GatewayID: referenced field was empty (referenced resource may not yet be ready)
├─ SecurityGroupRule/configuration-aws-network-kcl-gmdbl           sgr-mysql                                    False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.SecurityGroupID: referenced field was empty (referenced resource may not yet be ready)
├─ SecurityGroupRule/configuration-aws-network-kcl-qvxwq           sgr-postgres                                 False    -       ReconcileError: cannot resolve references: mg.Spec.ForProvider.SecurityGroupID: referenced field was empty (referenced resource may not yet be ready)
├─ SecurityGroup/configuration-aws-network-kcl-z957b               sg                                           True     True    Available
├─ Subnet/configuration-aws-network-kcl-lwpn7                      subnet-us-west-2b-192-168-64-0-18-public     True     False   Creating
├─ Subnet/configuration-aws-network-kcl-vcf7r                      subnet-us-west-2a-192-168-128-0-18-private   True     False   Creating
├─ Subnet/configuration-aws-network-kcl-vswkk                      subnet-us-west-2b-192-168-192-0-18-private   True     True    Available
├─ Subnet/configuration-aws-network-kcl-wwgf9                      subnet-us-west-2a-192-168-0-0-18-public      True     False   Creating
└─ VPC/configuration-aws-network-kcl-hxd6l                         vpc                                          True     True    Available
NAME                                                               RESOURCE                                     SYNCED   READY   STATUS
XNetwork/configuration-aws-network-kcl                                                                          True     False   Creating: Unready resources: mrt, route, rt, and 8 more
├─ InternetGateway/configuration-aws-network-kcl-ztq6x             igw                                          True     True    Available
├─ MainRouteTableAssociation/configuration-aws-network-kcl-dztdk   mrt                                          True     True    Available
├─ RouteTableAssociation/configuration-aws-network-kcl-4flcm       rta-us-west-2b-192-168-64-0-18-public        True     False   Creating
├─ RouteTableAssociation/configuration-aws-network-kcl-6zh6w       rta-us-west-2a-192-168-128-0-18-private      True     True    Available
├─ RouteTableAssociation/configuration-aws-network-kcl-kmwt2       rta-us-west-2b-192-168-192-0-18-private      True     False   Creating
├─ RouteTableAssociation/configuration-aws-network-kcl-mgx75       rta-us-west-2a-192-168-0-0-18-public         True     True    Available
├─ RouteTable/configuration-aws-network-kcl-tcpg5                  rt                                           True     True    Available
├─ Route/configuration-aws-network-kcl-xj7hz                       route                                        True     True    Available
├─ SecurityGroupRule/configuration-aws-network-kcl-gmdbl           sgr-mysql                                    True     False   Creating
├─ SecurityGroupRule/configuration-aws-network-kcl-qvxwq           sgr-postgres                                 True     False   Creating
├─ SecurityGroup/configuration-aws-network-kcl-z957b               sg                                           True     True    Available
├─ Subnet/configuration-aws-network-kcl-lwpn7                      subnet-us-west-2b-192-168-64-0-18-public     True     True    Available
├─ Subnet/configuration-aws-network-kcl-vcf7r                      subnet-us-west-2a-192-168-128-0-18-private   True     True    Available
├─ Subnet/configuration-aws-network-kcl-vswkk                      subnet-us-west-2b-192-168-192-0-18-private   True     True    Available
├─ Subnet/configuration-aws-network-kcl-wwgf9                      subnet-us-west-2a-192-168-0-0-18-public      True     True    Available
└─ VPC/configuration-aws-network-kcl-hxd6l                         vpc                                          True     True    Available
NAME                                                               RESOURCE                                     SYNCED   READY   STATUS
XNetwork/configuration-aws-network-kcl                                                                          True     False   Creating: Unready resources: rta-us-west-2b-192-168-192-0-18-private, rta-us-west-2b-192-168-64-0-18-public, sgr-mysql, and 1 more
├─ InternetGateway/configuration-aws-network-kcl-ztq6x             igw                                          True     True    Available
├─ MainRouteTableAssociation/configuration-aws-network-kcl-dztdk   mrt                                          True     True    Available
├─ RouteTableAssociation/configuration-aws-network-kcl-4flcm       rta-us-west-2b-192-168-64-0-18-public        True     False   Creating
├─ RouteTableAssociation/configuration-aws-network-kcl-6zh6w       rta-us-west-2a-192-168-128-0-18-private      True     True    Available
├─ RouteTableAssociation/configuration-aws-network-kcl-kmwt2       rta-us-west-2b-192-168-192-0-18-private      True     False   Creating
├─ RouteTableAssociation/configuration-aws-network-kcl-mgx75       rta-us-west-2a-192-168-0-0-18-public         True     True    Available
├─ RouteTable/configuration-aws-network-kcl-tcpg5                  rt                                           True     True    Available
├─ Route/configuration-aws-network-kcl-xj7hz                       route                                        True     True    Available
├─ SecurityGroupRule/configuration-aws-network-kcl-gmdbl           sgr-mysql                                    True     False   Creating
├─ SecurityGroupRule/configuration-aws-network-kcl-qvxwq           sgr-postgres                                 True     False   Creating
├─ SecurityGroup/configuration-aws-network-kcl-z957b               sg                                           True     True    Available
├─ Subnet/configuration-aws-network-kcl-lwpn7                      subnet-us-west-2b-192-168-64-0-18-public     True     True    Available
├─ Subnet/configuration-aws-network-kcl-vcf7r                      subnet-us-west-2a-192-168-128-0-18-private   True     True    Available
├─ Subnet/configuration-aws-network-kcl-vswkk                      subnet-us-west-2b-192-168-192-0-18-private   True     True    Available
├─ Subnet/configuration-aws-network-kcl-wwgf9                      subnet-us-west-2a-192-168-0-0-18-public      True     True    Available
└─ VPC/configuration-aws-network-kcl-hxd6l                         vpc                                          True     True    Available
NAME                                                               RESOURCE                                     SYNCED   READY   STATUS
XNetwork/configuration-aws-network-kcl                                                                          True     False   Creating: Unready resources: rta-us-west-2b-192-168-192-0-18-private, rta-us-west-2b-192-168-64-0-18-public, sgr-mysql, and 1 more
├─ InternetGateway/configuration-aws-network-kcl-ztq6x             igw                                          True     True    Available
├─ MainRouteTableAssociation/configuration-aws-network-kcl-dztdk   mrt                                          True     True    Available
├─ RouteTableAssociation/configuration-aws-network-kcl-4flcm       rta-us-west-2b-192-168-64-0-18-public        True     True    Available
├─ RouteTableAssociation/configuration-aws-network-kcl-6zh6w       rta-us-west-2a-192-168-128-0-18-private      True     True    Available
├─ RouteTableAssociation/configuration-aws-network-kcl-kmwt2       rta-us-west-2b-192-168-192-0-18-private      True     True    Available
├─ RouteTableAssociation/configuration-aws-network-kcl-mgx75       rta-us-west-2a-192-168-0-0-18-public         True     True    Available
├─ RouteTable/configuration-aws-network-kcl-tcpg5                  rt                                           True     True    Available
├─ Route/configuration-aws-network-kcl-xj7hz                       route                                        True     True    Available
├─ SecurityGroupRule/configuration-aws-network-kcl-gmdbl           sgr-mysql                                    True     True    Available
├─ SecurityGroupRule/configuration-aws-network-kcl-qvxwq           sgr-postgres                                 True     True    Available
├─ SecurityGroup/configuration-aws-network-kcl-z957b               sg                                           True     True    Available
├─ Subnet/configuration-aws-network-kcl-lwpn7                      subnet-us-west-2b-192-168-64-0-18-public     True     True    Available
├─ Subnet/configuration-aws-network-kcl-vcf7r                      subnet-us-west-2a-192-168-128-0-18-private   True     True    Available
├─ Subnet/configuration-aws-network-kcl-vswkk                      subnet-us-west-2b-192-168-192-0-18-private   True     True    Available
├─ Subnet/configuration-aws-network-kcl-wwgf9                      subnet-us-west-2a-192-168-0-0-18-public      True     True    Available
└─ VPC/configuration-aws-network-kcl-hxd6l                         vpc                                          True     True    Available
    | 00:23:11 | apply | Assert Status Conditions | ASSERT    | DONE  | aws.platform.upbound.io/v1alpha1/XNetwork @ configuration-aws-network-kcl
    | 00:23:11 | apply | Assert Status Conditions | TRY       | END   |
    | 00:23:11 | apply | @chainsaw                | CLEANUP   | SKIP  |
=== NAME  chainsaw
    | 00:23:11 | chainsaw | @chainsaw | CLEANUP   | SKIP  |
--- PASS: chainsaw (0.00s)
    --- PASS: chainsaw/apply (201.07s)
PASS
2025/03/15 00:23:11 Tests Summary:
2025/03/15 00:23:11 - Passed: 1
2025/03/15 00:23:11 - Failed: 0
2025/03/15 00:23:11 - Skipped: 0
2025/03/15 00:23:11 Skipping test 01-update.yaml
2025/03/15 00:23:11 Loading default configuration...
2025/03/15 00:23:11 - Using test file: 02-import.yaml
2025/03/15 00:23:11 - ApplyTimeout 5s
2025/03/15 00:23:11 - AssertTimeout 30s
2025/03/15 00:23:11 - CleanupTimeout 30s
2025/03/15 00:23:11 - DeleteTimeout 15s
2025/03/15 00:23:11 - ErrorTimeout 30s
2025/03/15 00:23:11 - ExecTimeout 5s
2025/03/15 00:23:11 - Parallel 1
2025/03/15 00:23:11 Loading tests...
2025/03/15 00:23:11 - import (/var/folders/ym/wqrhc4wd0mj6b1wbkc25s0_80000gn/T/uptest-e2e/case)
2025/03/15 00:23:11 Running tests...
=== RUN   chainsaw
=== PAUSE chainsaw
=== CONT  chainsaw
=== RUN   chainsaw/import
=== PAUSE chainsaw/import
=== CONT  chainsaw/import
    | 00:23:11 | import | @chainsaw                        | CREATE    | OK    | v1/Namespace @ chainsaw-picked-whippet
    | 00:23:11 | import | Remove State                     | TRY       | BEGIN |
    | 00:23:11 | import | Remove State                     | CMD       | RUN   |
        === COMMAND
        /bin/sh -c ${KUBECTL} annotate xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl crossplane.io/paused=true --overwrite
        ${KUBECTL} scale deployment crossplane -n ${CROSSPLANE_NAMESPACE} --replicas=0 --timeout 10s
        ${KUBECTL} -n ${CROSSPLANE_NAMESPACE} get deploy --no-headers -o custom-columns=":metadata.name" | grep "provider-" | xargs ${KUBECTL} -n ${CROSSPLANE_NAMESPACE} scale deploy --replicas=0
    | 00:23:13 | import | Remove State                     | SCRIPT    | LOG   |
        === STDOUT
        xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl annotated
        deployment.apps/crossplane scaled
        deployment.apps/upbound-provider-aws-ec2-21aa53711e54 scaled
        deployment.apps/upbound-provider-family-aws-20202ddbd61a scaled
    | 00:23:13 | import | Remove State                     | SCRIPT    | DONE  |
    | 00:23:13 | import | Remove State                     | SLEEP     | RUN   |
    | 00:23:23 | import | Remove State                     | SLEEP     | DONE  |
    | 00:23:23 | import | Remove State                     | CMD       | RUN   |
        === COMMAND
        /bin/sh -c ${KUBECTL} scale deployment crossplane -n ${CROSSPLANE_NAMESPACE} --replicas=1 --timeout 10s
        ${KUBECTL} -n ${CROSSPLANE_NAMESPACE} get deploy --no-headers -o custom-columns=":metadata.name" | grep "provider-" | xargs ${KUBECTL} -n ${CROSSPLANE_NAMESPACE} scale deploy --replicas=1
        curl -sL https://raw.githubusercontent.com/crossplane/uptest/main/hack/check_endpoints.sh -o /tmp/check_endpoints.sh && chmod +x /tmp/check_endpoints.sh
        curl -sL https://raw.githubusercontent.com/crossplane/uptest/main/hack/patch.sh -o /tmp/patch.sh && chmod +x /tmp/patch.sh
        /tmp/check_endpoints.sh
        /tmp/patch.sh xnetwork.aws.platform.upbound.io configuration-aws-network-kcl
        ${KUBECTL} annotate xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl --all crossplane.io/paused=false --overwrite
    | 00:23:31 | import | Remove State                     | SCRIPT    | LOG   |
        === STDOUT
        deployment.apps/crossplane scaled
        deployment.apps/upbound-provider-aws-ec2-21aa53711e54 scaled
        deployment.apps/upbound-provider-family-aws-20202ddbd61a scaled
        upbound-provider-aws-ec2 - No served ports
        upbound-provider-aws-ec2 - Ports present
        upbound-provider-family-aws - Ports present
        xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl patched
        Successfully patched xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl
        xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl annotated
        xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl annotated
        === STDERR
        Retrying... (1/10)
    | 00:23:31 | import | Remove State                     | SCRIPT    | DONE  |
    | 00:23:31 | import | Remove State                     | TRY       | END   |
    | 00:23:31 | import | Assert Status Conditions and IDs | TRY       | BEGIN |
    | 00:23:31 | import | Assert Status Conditions and IDs | ASSERT    | RUN   | aws.platform.upbound.io/v1alpha1/XNetwork @ configuration-aws-network-kcl
    | 00:23:33 | import | Assert Status Conditions and IDs | ASSERT    | DONE  | aws.platform.upbound.io/v1alpha1/XNetwork @ configuration-aws-network-kcl
    | 00:23:33 | import | Assert Status Conditions and IDs | ASSERT    | RUN   | aws.platform.upbound.io/v1alpha1/XNetwork @ configuration-aws-network-kcl
    | 00:23:33 | import | Assert Status Conditions and IDs | ASSERT    | DONE  | aws.platform.upbound.io/v1alpha1/XNetwork @ configuration-aws-network-kcl
    | 00:23:33 | import | Assert Status Conditions and IDs | TRY       | END   |
    | 00:23:33 | import | @chainsaw                        | CLEANUP   | SKIP  |
=== NAME  chainsaw
    | 00:23:33 | chainsaw | @chainsaw | CLEANUP   | SKIP  |
--- PASS: chainsaw (0.00s)
    --- PASS: chainsaw/import (21.35s)
PASS
2025/03/15 00:23:33 Tests Summary:
2025/03/15 00:23:33 - Passed: 1
2025/03/15 00:23:33 - Failed: 0
2025/03/15 00:23:33 - Skipped: 0
2025/03/15 00:23:33 Loading default configuration...
2025/03/15 00:23:33 - Using test file: 03-delete.yaml
2025/03/15 00:23:33 - ApplyTimeout 5s
2025/03/15 00:23:33 - AssertTimeout 30s
2025/03/15 00:23:33 - CleanupTimeout 30s
2025/03/15 00:23:33 - DeleteTimeout 15s
2025/03/15 00:23:33 - ErrorTimeout 30s
2025/03/15 00:23:33 - ExecTimeout 5s
2025/03/15 00:23:33 - Parallel 1
2025/03/15 00:23:33 Loading tests...
2025/03/15 00:23:33 - delete (/var/folders/ym/wqrhc4wd0mj6b1wbkc25s0_80000gn/T/uptest-e2e/case)
2025/03/15 00:23:33 Running tests...
=== RUN   chainsaw
=== PAUSE chainsaw
=== CONT  chainsaw
=== RUN   chainsaw/delete
=== PAUSE chainsaw/delete
=== CONT  chainsaw/delete
    | 00:23:33 | delete | @chainsaw        | CREATE    | OK    | v1/Namespace @ chainsaw-elegant-wasp
    | 00:23:33 | delete | Delete Resources | TRY       | BEGIN |
    | 00:23:33 | delete | Delete Resources | CMD       | RUN   |
        === COMMAND
        /bin/sh -c ${KUBECTL} delete xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl --wait=false --ignore-not-found
    | 00:23:33 | delete | Delete Resources | SCRIPT    | LOG   |
        === STDOUT
        xnetwork.aws.platform.upbound.io "configuration-aws-network-kcl" deleted
    | 00:23:33 | delete | Delete Resources | SCRIPT    | DONE  |
    | 00:23:33 | delete | Delete Resources | TRY       | END   |
    | 00:23:33 | delete | Assert Deletion  | TRY       | BEGIN |
    | 00:23:33 | delete | Assert Deletion  | CMD       | RUN   |
        === COMMAND
        /bin/sh -c ${KUBECTL} wait --for=delete xnetwork.aws.platform.upbound.io/configuration-aws-network-kcl --timeout 40m0s
    | 00:23:33 | delete | Assert Deletion  | SCRIPT    | DONE  |
    | 00:23:33 | delete | Assert Deletion  | CMD       | RUN   |
        === COMMAND
        /bin/sh -c ${KUBECTL} wait managed --all --for=delete --timeout -1s
    | 00:23:40 | delete | Assert Deletion  | SCRIPT    | LOG   |
        === STDOUT
        route.ec2.aws.upbound.io/configuration-aws-network-kcl-xj7hz condition met
        securitygroup.ec2.aws.upbound.io/configuration-aws-network-kcl-z957b condition met
        vpc.ec2.aws.upbound.io/configuration-aws-network-kcl-hxd6l condition met
    | 00:23:40 | delete | Assert Deletion  | SCRIPT    | DONE  |
    | 00:23:40 | delete | Assert Deletion  | TRY       | END   |
    | 00:23:40 | delete | @chainsaw        | CLEANUP   | SKIP  |
=== NAME  chainsaw
    | 00:23:40 | chainsaw | @chainsaw | CLEANUP   | SKIP  |
--- PASS: chainsaw (0.00s)
    --- PASS: chainsaw/delete (7.00s)
PASS
2025/03/15 00:23:40 Tests Summary:
2025/03/15 00:23:40 - Passed: 1
2025/03/15 00:23:40 - Failed: 0
2025/03/15 00:23:40 - Skipped: 0
00:23:40 [ OK ] running automated tests

Copy link

@adamwg adamwg left a comment

Choose a reason for hiding this comment

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

One note, lgtm otherwise.

ticker := time.NewTicker(t.options.LogCollectionInterval)
done := make(chan bool)
var mutex sync.Mutex
Copy link

Choose a reason for hiding this comment

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

Looks like this mutex is used only inside logCollector, so it could be declared created inside logCollector instead of passing it in.

Copy link
Member

Choose a reason for hiding this comment

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

There is a significant increase in dependencies, including chainsaw, crossplane as a library, and other indirect dependencies. Consider whether all these dependencies are necessary for this PR to prevent long-term maintenance issues. If some dependencies are only used in a specific module, can we limit their scope?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

think most of the dependencies are from chainsaw regarding auth plugins

Comment on lines +106 to +108
configuration.Spec.Discovery.TestFile = tf
configuration.Spec.Execution.Parallel = ptr.To(1)
configuration.Spec.Cleanup.SkipDelete = true
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to set any other configuration field for preserving the old behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

before we used the binary input parameters

${CHAINSAW}" test --test-dir %s --test-file %s --skip-delete --parallel 1

--test-dir %s
which maps to tests, err := discovery.DiscoverTests(tf, nil, false, t.options.Directory)

--test-file %s
which maps to configuration.Spec.Discovery.TestFile = tf

--skip-delete
which maps to configuration.Spec.Cleanup.SkipDelete = true

--parallel 1
which maps to configuration.Spec.Execution.Parallel = ptr.To(1)

chainsaw is using default when you not explicit set some of the inputs configuration, err := kconfig.DefaultConfiguration()

Comment on lines +110 to +117
log.Printf("- Using test file: %s\n", configuration.Spec.Discovery.TestFile)
log.Printf("- ApplyTimeout %v\n", configuration.Spec.Timeouts.Apply.Duration)
log.Printf("- AssertTimeout %v\n", configuration.Spec.Timeouts.Assert.Duration)
log.Printf("- CleanupTimeout %v\n", configuration.Spec.Timeouts.Cleanup.Duration)
log.Printf("- DeleteTimeout %v\n", configuration.Spec.Timeouts.Delete.Duration)
log.Printf("- ErrorTimeout %v\n", configuration.Spec.Timeouts.Error.Duration)
log.Printf("- ExecTimeout %v\n", configuration.Spec.Timeouts.Exec.Duration)
log.Printf("- Parallel %d\n", *configuration.Spec.Execution.Parallel)
Copy link
Member

Choose a reason for hiding this comment

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

We have some timeout override mechanisms in the template and example manifest files. I am curious about, can we have still this capability after the changes? Did we check this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have 2 layers of configuration - default configuration and test specific overrides - we let chainsaw library handling the overrides like before

defer cancel()

if err := runnerflags.SetupFlags(configuration.Spec); err != nil {
return err
}
Copy link
Member

Choose a reason for hiding this comment

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

It used to be that the logs of the CLI were printed here in a stream and as they came in, is this the case now? Or are they printed once for a test execution and then all together?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

does this help to see the log flow in a uptest run?

https://www.loom.com/share/a21158bb0d0945c984ca5f385a26181f

mutex.Lock()
log.Println(sc.Text())
mutex.Unlock()
ctx, cancel := context.WithTimeout(context.Background(), timeout)
Copy link
Member

Choose a reason for hiding this comment

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

Just a comment about the timeouts. Since the chainsaw doesn't have global timeouts for test suites we created the context.WithTimeout and passed it to the exec.CommandContext. The aim is killing the all child processes also with this. Do you think are we able to protect this behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants