@@ -724,42 +724,92 @@ jobs:
724724 - 7.6.8
725725 - 7.2.9
726726 steps :
727- - name : Install cbdinocluster
728- run : |
729- mkdir -p "$HOME/bin"
730- curl -L -o "$HOME/bin/cbdinocluster" https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.98/cbdinocluster-linux-amd64
731- chmod a+x "$HOME/bin/cbdinocluster"
732- echo "$HOME/bin" >> $GITHUB_PATH
733- - name : Initialize cbdinocluster
727+ - name : Create Couchbase cluster
728+ id : create-cluster
729+ uses : ./.github/actions/create-cluster
730+ with :
731+ version : ${{ matrix.server }}
732+ - uses : actions/download-artifact@v4
733+ with :
734+ name : couchbase-${{ needs.source.outputs.gem_version }}-x86_64-linux
735+ - uses : actions/download-artifact@v4
736+ with :
737+ name : couchbase-opentelemetry-${{ needs.source.outputs.otel_gem_version }}
738+ - uses : actions/download-artifact@v4
739+ with :
740+ name : scripts-${{ needs.source.outputs.gem_version }}
741+ - uses : actions/download-artifact@v4
742+ with :
743+ name : tests-${{ needs.source.outputs.gem_version }}
744+ - uses : ruby/setup-ruby@v1
745+ with :
746+ ruby-version : 3.3
747+ - name : Install
734748 run : |
735- cbdinocluster -v init --auto
736- - name : Start couchbase cluster
749+ COUCHBASE_GEM_PATH=$(realpath couchbase-${{ needs.source.outputs.gem_version }}-*.gem)
750+ COUCHBASE_OPENTELEMETRY_GEM_PATH=$(realpath couchbase-opentelemetry-${{ needs.source.outputs.otel_gem_version }}.gem)
751+ mkdir -p local-gem-repo/gems
752+ mv ${COUCHBASE_GEM_PATH} local-gem-repo/gems
753+ mv ${COUCHBASE_OPENTELEMETRY_GEM_PATH} local-gem-repo/gems
754+ GEM_REPO_PATH=$(realpath local-gem-repo)
755+ gem generate_index --directory local-gem-repo
756+ ruby -i.bak -pe "gsub(/gemspec$/, 'gem \"couchbase\", source: \"file://${GEM_REPO_PATH}\"')" Gemfile
757+ ruby -i.bak -pe "gsub(/gemspec path: \"couchbase-opentelemetry\"$/, 'gem \"couchbase-opentelemetry\", source: \"file://${GEM_REPO_PATH}\"')" Gemfile
758+ bundle install
759+ bundle exec ruby -r bundler/setup -r couchbase -r couchbase/opentelemetry -e 'pp Couchbase::VERSION, Couchbase::BUILD_INFO, {otel: Couchbase::OpenTelemetry::VERSION}'
760+ - name : Test
737761 env :
738- CLUSTERCONFIG : |
739- nodes:
740- - count: 2
741- version: ${{ matrix.server }}
742- services:
743- - kv
744- - n1ql
745- - index
746- - count: 1
747- version: ${{ matrix.server }}
748- services:
749- - kv
750- - fts
751- - cbas
752- docker:
753- kv-memory: 1500
754- fts-memory: 2048
755- expiry: 1h
762+ TEST_CONNECTION_STRING : ${{ steps.create-cluster.outputs.connstr }}?dump_configuration=true
763+ TEST_SERVER_VERSION : ${{ matrix.server }}
764+ run : |
765+ bundle exec rake test
766+ - name : Publish Test Report
767+ uses : mikepenz/action-junit-report@v4.1.0
768+ if : always()
769+ with :
770+ check_name : 🐧server, ee-${{ matrix.server }}
771+ report_paths : test/reports/*.xml
772+ require_tests : true
773+ annotate_only : true
774+ - name : Collect server logs
775+ timeout-minutes : 15
776+ if : failure()
756777 run : |
757- CLUSTER_ID=$(cbdinocluster -v allocate --def="${CLUSTERCONFIG}")
758- CONNECTION_STRING=$(cbdinocluster -v connstr "${CLUSTER_ID}")
759- cbdinocluster -v buckets add ${CLUSTER_ID} default --ram-quota-mb=100 --flush-enabled=true
760- cbdinocluster -v buckets load-sample ${CLUSTER_ID} travel-sample
761- echo "CLUSTER_ID=${CLUSTER_ID}" >> "$GITHUB_ENV"
762- echo "TEST_CONNECTION_STRING=${CONNECTION_STRING}?dump_configuration=true" >> "$GITHUB_ENV"
778+ mkdir -p logs
779+ cbdinocluster -v collect-logs ${{ steps.create-cluster.outputs.id }} ./logs
780+ - name : Upload logs
781+ if : failure()
782+ uses : actions/upload-artifact@v4
783+ with :
784+ name : ${{ github.job }}-${{ github.run_attempt }}-${{ matrix.server }}-logs
785+ path : |
786+ logs/*
787+ test/**/*.{log,xml}
788+ retention-days : 5
789+
790+ test_linux_x86_64_cng :
791+ timeout-minutes : 60
792+ needs :
793+ - source
794+ - repackage_linux_x86_64
795+ runs-on : ubuntu-22.04
796+ strategy :
797+ fail-fast : false
798+ matrix :
799+ server :
800+ - 8.0.0
801+ steps :
802+ - uses : actions/checkout@v4
803+ - name : Create Couchbase cluster
804+ id : create-cluster
805+ uses : ./.github/actions/create-cluster
806+ with :
807+ version : ${{ matrix.server }}
808+ - name : Start CNG
809+ id : start-cng
810+ uses : ./.github/actions/start-cng
811+ with :
812+ couchbase-hostname : ${{ steps.create-cluster.outputs.ip }}
763813 - uses : actions/download-artifact@v4
764814 with :
765815 name : couchbase-${{ needs.source.outputs.gem_version }}-x86_64-linux
@@ -790,14 +840,15 @@ jobs:
790840 bundle exec ruby -r bundler/setup -r couchbase -r couchbase/opentelemetry -e 'pp Couchbase::VERSION, Couchbase::BUILD_INFO, {otel: Couchbase::OpenTelemetry::VERSION}'
791841 - name : Test
792842 env :
843+ TEST_CONNECTION_STRING : ${{ steps.start-cng.outputs.cng-connection-string }}?trust_certificate=${{ steps.start-cng.outputs.ca-cert-path }}
793844 TEST_SERVER_VERSION : ${{ matrix.server }}
794845 run : |
795846 bundle exec rake test
796847 - name : Publish Test Report
797848 uses : mikepenz/action-junit-report@v4.1.0
798849 if : always()
799850 with :
800- check_name : 🐧server , ee-${{ matrix.server }}
851+ check_name : 🐧cng , ee-${{ matrix.server }}
801852 report_paths : test/reports/*.xml
802853 require_tests : true
803854 annotate_only : true
@@ -806,7 +857,7 @@ jobs:
806857 if : failure()
807858 run : |
808859 mkdir -p logs
809- cbdinocluster -v collect-logs $CLUSTER_ID ./logs
860+ cbdinocluster -v collect-logs ${{ steps.create-cluster.outputs.id }} ./logs
810861 - name : Upload logs
811862 if : failure()
812863 uses : actions/upload-artifact@v4
0 commit comments