Skip to content
Closed
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
8 changes: 6 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ permissions: {}

on:
push:
branches: [ main ]
branches:
- main
- release*
pull_request:
branches: [ main ]
branches:
- main
- release*

env:
LLVM_VERSION: 20
Expand Down
45 changes: 40 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ permissions: {}

on:
push:
branches: [main]
branches:
- main
- release*
pull_request:
branches: [main]
branches:
- main
- release*

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -22,6 +26,10 @@ jobs:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
Expand Down Expand Up @@ -105,6 +113,7 @@ jobs:
make \
openssl \
openssl-dev \
curl-dev \
readline-dev \
ruby \
tar \
Expand Down Expand Up @@ -363,7 +372,7 @@ jobs:

build_macos_x86_64:
needs: source
runs-on: macos-13
runs-on: macos-15-intel
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -402,7 +411,7 @@ jobs:
needs:
- source
- build_macos_x86_64
runs-on: macos-13
runs-on: macos-15-intel
steps:
- uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -450,6 +459,10 @@ jobs:
- '3.3'
- '3.4'
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- uses: actions/download-artifact@v4
with:
name: couchbase-${{ needs.source.outputs.gem_version }}-x86_64-linux
Expand Down Expand Up @@ -551,6 +564,15 @@ jobs:
logs/*
test/**/*.{log,xml}
retention-days: 5
- name: Upload crash logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}-${{ github.run_attempt }}-${{ matrix.ruby }}-crash
path: |
~/Library/Logs/DiagnosticReports/
/Library/Logs/DiagnosticReports/
retention-days: 5
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4.1.0
if: always()
Expand All @@ -565,7 +587,7 @@ jobs:
needs:
- source
- repackage_macos_x86_64
runs-on: macos-13
runs-on: macos-15-intel
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -612,6 +634,15 @@ jobs:
logs/*
test/**/*.{log,xml}
retention-days: 5
- name: Upload crash logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}-${{ github.run_attempt }}-${{ matrix.ruby }}-crash
path: |
~/Library/Logs/DiagnosticReports/
/Library/Logs/DiagnosticReports/
retention-days: 5
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4.1.0
if: always()
Expand All @@ -636,6 +667,10 @@ jobs:
- 7.1.6
- 7.0.5
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Install cbdinocluster
run: |
mkdir -p "$HOME/bin"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/pkg/
/test/reports/
/tmp/
/logs/
/vendor/bundle/
Gemfile.lock
Makefile
Expand Down
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
url = https://github.com/couchbaselabs/sdk-testcases.git
[submodule "ext/couchbase"]
path = ext/couchbase
url = https://github.com/couchbaselabs/couchbase-cxx-client.git
#url = https://github.com/couchbaselabs/couchbase-cxx-client.git
url = https://github.com/avsej/couchbase-cxx-client.git
[submodule "deps/protostellar"]
path = deps/protostellar
url = https://github.com/couchbase/protostellar.git
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ gem "rake"

group :development do
gem "activesupport", "~> 7.0.3"
gem "curb"
gem "irb"
gem "drb"
gem "faker"
gem "flay"
gem "flog"
gem "gem-compiler"
gem "grpc-tools", "~> 1.59"
gem "grpc-tools", "~> 1.59", require: false
gem "heckle"
gem "minitest"
gem "minitest", "< 6.0"
gem "minitest-reporters"
gem "mutex_m"
gem "rack"
Expand Down
14 changes: 14 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if ARGV.delete("--trace-loaded-features") || ENV["COUCHBASE_TRACE_LOADED_FEATURES"]
loaded_before = $LOADED_FEATURES.dup
set_trace_func -> (event, file, line, id, binding, klass) do
if event == 'c-return' && [:require, :load].include?(id)
new_loads = $LOADED_FEATURES - loaded_before
unless new_loads.empty?
puts "#{file}:#{line}"
new_loads.each { |path| puts " LOADED: #{path}" }
loaded_before.concat(new_loads)
end
end
end
end

require "bundler/setup"
require "irb"
require "open3"
Expand Down
4 changes: 3 additions & 1 deletion ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
endif()

if(APPLE)
target_link_libraries(couchbase PRIVATE -Wl,-undefined,dynamic_lookup)
target_link_options(couchbase PRIVATE
-Wl,-undefined,dynamic_lookup
)
endif()
2 changes: 1 addition & 1 deletion ext/couchbase
2 changes: 1 addition & 1 deletion lib/couchbase/cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
require "couchbase/analytics_options"
require "couchbase/diagnostics"

require "couchbase/protostellar"
# require "couchbase/protostellar"

module Couchbase
# The main entry point when connecting to a Couchbase cluster.
Expand Down
2 changes: 2 additions & 0 deletions lib/couchbase/protostellar/generated/kv/v1/kv_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions test/mock_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,33 @@
require "fileutils"
require "tmpdir"
require "socket"
require "curb"

class Caves
attr_accessor :verbose

VERSION = "v0.0.1-78"
VERSION = "v0.0.1-79"
FORK = "couchbaselabs"

def download_mock(url = caves_url)
return if binary_ready?

puts "download #{url}"
resp = Net::HTTP.get_response(URI.parse(url))

case resp
when Net::HTTPSuccess
raise "Unexpected content type: #{resp['content-type']}" if resp["content-type"] != "application/octet-stream"
curl = Curl::Easy.new(url) do |c|
c.follow_location = true
c.max_redirects = 5
end
curl.perform

case curl.response_code
when 200..299
raise "Unexpected content type: #{curl.content_type}" if curl.content_type != "application/octet-stream"
FileUtils.mkdir_p(caves_dir, verbose: verbose?)
File.write(mock_path, resp.body, binmode: true)
File.write(mock_path, curl.body, binmode: true)
FileUtils.chmod("a+x", mock_path, verbose: verbose?) unless windows?
when Net::HTTPRedirection
download_mock(resp["location"])
else
raise "Unable to download mock from #{url}: #{resp.status}"
raise "Unable to download mock from #{url}: #{curl.response_code}"
end
end

Expand Down
2 changes: 2 additions & 0 deletions test/protostellar/retry_orchestrator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

require "test_helper"

return

require "couchbase/protostellar/request_generator/kv"
require "couchbase/protostellar/request_behaviour"
require "couchbase/protostellar/retry/orchestrator"
Expand Down
19 changes: 19 additions & 0 deletions test/search_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if ENV["COUCHBASE_TRACE_LOADED_FEATURES"]
unless defined?(COUCHBASE_LOADED_FEATURES_TRACE_FUNC)
loaded_before = $LOADED_FEATURES.dup

COUCHBASE_LOADED_FEATURES_TRACE_FUNC = -> (event, file, line, id, binding, klass) do
if event == 'c-return' && [:require, :load].include?(id)
new_loads = $LOADED_FEATURES - loaded_before
unless new_loads.empty?
puts "#{file}:#{line}"
new_loads.each { |path| puts " LOADED: #{path}" }
loaded_before.concat(new_loads)
end
end
end

set_trace_func(COUCHBASE_LOADED_FEATURES_TRACE_FUNC)
end
end

require_relative "test_helper"

module Couchbase
Expand Down
Loading