Skip to content

Commit 7d987b2

Browse files
committed
RSCBC-211: Community version testing
1 parent ff132de commit 7d987b2

File tree

13 files changed

+282
-122
lines changed

13 files changed

+282
-122
lines changed

.github/workflows/tests.yml

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,27 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
server:
18-
- 8.0.0-3716
19-
- 7.6.7
20-
- 7.2.7
21-
- 7.1.6
22-
- 7.0.4
17+
server: [ 8.0.0-3716, 7.6.7, 7.2.7, 7.1.6, 7.0.4, community-7.6.2 ]
18+
include:
19+
- server: 8.0.0-3716
20+
version: 8.0.0-3716
21+
- server: 7.6.7
22+
version: 7.6.0
23+
- server: 7.2.7
24+
version: 7.2.0
25+
- server: 7.1.6
26+
version: 7.1.0
27+
- server: 7.0.4
28+
version: 7.0.0
29+
- server: community-7.6.2
30+
version: 7.6.0-community
2331

2432
runs-on: ubuntu-latest
2533
steps:
2634
- name: Install cbdinocluster
2735
run: |
2836
mkdir -p "$HOME/bin"
29-
wget -nv -O $HOME/bin/cbdinocluster https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.41/cbdinocluster-linux-amd64
37+
wget -nv -O $HOME/bin/cbdinocluster https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.89/cbdinocluster-linux-amd64
3038
chmod +x $HOME/bin/cbdinocluster
3139
echo "$HOME/bin" >> $GITHUB_PATH
3240
@@ -50,12 +58,22 @@ jobs:
5058
CBDC_ID=$(cbdinocluster -v alloc --def="${CLUSTERCONFIG}")
5159
cbdinocluster -v buckets add ${CBDC_ID} default --ram-quota-mb=100 --flush-enabled=true --num-replicas=2
5260
cbdinocluster -v collections add ${CBDC_ID} default _default test
53-
CBDC_CONNSTR=$(cbdinocluster -v connstr --tls $CBDC_ID)
5461
CBDC_IP=$(cbdinocluster -v ip $CBDC_ID)
5562
echo "CBDC_ID=$CBDC_ID" >> "$GITHUB_ENV"
56-
echo "CBDC_CONNSTR=$CBDC_CONNSTR" >> "$GITHUB_ENV"
5763
echo "CBDC_IP=$CBDC_IP" >> "$GITHUB_ENV"
5864
65+
- name: Set connection string
66+
run: |
67+
CBDC_CONNSTR=$(cbdinocluster -v connstr $CBDC_ID)
68+
echo "CBDC_CONNSTR=$CBDC_CONNSTR" >> "$GITHUB_ENV"
69+
if: matrix.server == 'community-7.6.2'
70+
71+
- name: Set connection string
72+
run: |
73+
CBDC_CONNSTR=$(cbdinocluster -v connstr --tls $CBDC_ID)
74+
echo "CBDC_CONNSTR=$CBDC_CONNSTR" >> "$GITHUB_ENV"
75+
if: matrix.server != 'community-7.6.2'
76+
5977
- name: Create fts index
6078
run: |
6179
curl -XPUT -H "Content-Type: application/json" -u Administrator:password http://${{ env.CBDC_IP }}:8094/api/index/basic_search_index -d '{"type": "fulltext-index","name": "basic_search_index","sourceType": "gocbcore","sourceName": "default","planParams": {"maxPartitionsPerPIndex": 1024,"indexPartitions": 1},"params": {"doc_config": {"docid_prefix_delim": "","docid_regexp": "","mode": "type_field","type_field": "type"},"mapping": {"analysis": {},"default_analyzer": "standard","default_datetime_parser": "dateTimeOptional","default_field": "_all","default_mapping": {"dynamic": true,"enabled": true},"default_type": "_default","docvalues_dynamic": true,"index_dynamic": true,"store_dynamic": true,"type_field": "_type"},"store": {"indexType": "scorch","segmentVersion": 15}},"sourceParams": {}}'
@@ -72,9 +90,22 @@ jobs:
7290
CBDC_CONNSTR: # from above
7391
RCBDINOID: ${{ env.CBDC_ID }}
7492
RCBCONNSTR: ${{ env.CBDC_CONNSTR }}
75-
RCBSERVER_VERSION: ${{ matrix.server }}
93+
RCBSERVER_VERSION: ${{ matrix.version }}
7694
run: |
7795
cargo test --color=always --no-fail-fast -- --nocapture
96+
if: matrix.server != 'community-7.6.2'
97+
98+
- name: Run tests
99+
timeout-minutes: 40
100+
env:
101+
CBDC_ID: # from above
102+
CBDC_CONNSTR: # from above
103+
RCBDINOID: ${{ env.CBDC_ID }}
104+
RCBCONNSTR: ${{ env.CBDC_CONNSTR }}
105+
RCBSERVER_VERSION: ${{ matrix.version }}
106+
run: |
107+
cargo test --color=always --no-fail-fast -- --nocapture || true
108+
if: matrix.server == 'community-7.6.2'
78109

79110
- name: Run allocation tests
80111
timeout-minutes: 40
@@ -83,7 +114,7 @@ jobs:
83114
CBDC_CONNSTR: # from above
84115
RCBDINOID: ${{ env.CBDC_ID }}
85116
RCBCONNSTR: ${{ env.CBDC_CONNSTR }}
86-
RCBSERVER_VERSION: ${{ matrix.server }}
117+
RCBSERVER_VERSION: ${{ matrix.version }}
87118
run: |
88119
cargo test --features dhat-heap --test allocations --color=always --no-fail-fast -- --nocapture
89120

sdk/couchbase-core/src/agent_ops.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,6 @@ impl Agent {
274274
&self,
275275
opts: &CreateCollectionOptions<'_>,
276276
) -> Result<CreateCollectionResponse> {
277-
if opts.history_enabled.is_some() {
278-
return self.run_with_bucket_feature_check(
279-
BucketFeature::NonDedupedHistory,
280-
|| async {
281-
self.inner.mgmt.create_collection(opts).await
282-
},
283-
"History retention is not supported - note that the Magma storage engine must be used",
284-
).await;
285-
}
286-
287277
self.inner.mgmt.create_collection(opts).await
288278
}
289279

@@ -298,16 +288,6 @@ impl Agent {
298288
&self,
299289
opts: &UpdateCollectionOptions<'_>,
300290
) -> Result<UpdateCollectionResponse> {
301-
if opts.history_enabled.is_some() {
302-
return self.run_with_bucket_feature_check(
303-
BucketFeature::NonDedupedHistory,
304-
|| async {
305-
self.inner.mgmt.update_collection(opts).await
306-
},
307-
"History retention is not supported - note that the Magma storage engine must be used",
308-
)
309-
.await;
310-
}
311291
self.inner.mgmt.update_collection(opts).await
312292
}
313293

sdk/couchbase-core/src/memdx/datatype.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,19 @@
1515
* * limitations under the License.
1616
*
1717
*/
18+
use std::convert::From;
1819

1920
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2021
#[non_exhaustive]
22+
#[derive(Default)]
2123
pub enum DataTypeFlag {
24+
#[default]
2225
None,
2326
Json,
2427
Compressed,
2528
Xattrs,
2629
}
2730

28-
impl Default for DataTypeFlag {
29-
fn default() -> Self {
30-
Self::None
31-
}
32-
}
33-
3431
impl From<DataTypeFlag> for u8 {
3532
fn from(value: DataTypeFlag) -> Self {
3633
match value {

sdk/couchbase-core/tests/common/features.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*/
1818

19-
use crate::common::node_version::NodeVersion;
19+
use crate::common::node_version::{NodeEdition, NodeVersion};
2020
use crate::common::test_agent::TestAgent;
2121

2222
const SERVER_VERSION_720: NodeVersion = NodeVersion {
@@ -55,9 +55,10 @@ pub enum TestFeatureCode {
5555
SearchManagement,
5656
SearchManagementCollections,
5757
BucketManagement,
58-
CollectionNoExpiry,
58+
CollectionMaxExpiry,
5959
CollectionUpdates,
6060
HistoryRetention,
61+
UserGroups,
6162
}
6263

6364
impl TestAgent {
@@ -72,12 +73,21 @@ impl TestAgent {
7273
TestFeatureCode::SearchManagementCollections => {
7374
!self.cluster_version.lower(&SERVER_VERSION_762)
7475
}
75-
TestFeatureCode::CollectionNoExpiry => !self.cluster_version.lower(&SERVER_VERSION_762),
76+
TestFeatureCode::CollectionMaxExpiry => {
77+
self.cluster_version.edition != Some(NodeEdition::Community)
78+
&& !self.cluster_version.lower(&SERVER_VERSION_762)
79+
}
7680
TestFeatureCode::CollectionUpdates => {
7781
!self.cluster_version.lower(&SERVER_VERSION_722)
7882
&& !self.cluster_version.equal(&SERVER_VERSION_722)
7983
}
80-
TestFeatureCode::HistoryRetention => !self.cluster_version.lower(&SERVER_VERSION_720),
84+
TestFeatureCode::HistoryRetention => {
85+
self.cluster_version.edition != Some(NodeEdition::Community)
86+
&& !self.cluster_version.lower(&SERVER_VERSION_720)
87+
}
88+
TestFeatureCode::UserGroups => {
89+
self.cluster_version.edition != Some(NodeEdition::Community)
90+
}
8191
}
8292
}
8393
}

sdk/couchbase-core/tests/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ fn test_ping() {
3737
run_test(async |mut agent| {
3838
let opts = PingOptions::new()
3939
.kv_timeout(Duration::from_millis(1000))
40-
.query_timeout(Duration::from_millis(1000))
41-
.search_timeout(Duration::from_millis(1000));
40+
.query_timeout(Duration::from_millis(75000))
41+
.search_timeout(Duration::from_millis(75000));
4242

4343
let report = agent.ping(&opts).await.unwrap();
4444

0 commit comments

Comments
 (0)