Skip to content

Commit

Permalink
Add a test to cover
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Jan 22, 2025
1 parent 81af05b commit f4e1ee1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
37 changes: 37 additions & 0 deletions .github/services/webhdfs/webhdfs_with_user_name/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: webhdfs
description: "Behavior test for webhdfs with user name specified"

runs:
using: "composite"
steps:
- name: Setup webhdfs
shell: bash
working-directory: fixtures/webhdfs
run: |
docker compose -f docker-compose-webhdfs.yml up -d --wait
- name: Setup
shell: bash
run: |
cat << EOF >> $GITHUB_ENV
OPENDAL_WEBHDFS_ROOT=/
OPENDAL_WEBHDFS_ENDPOINT=http://127.0.0.1:9870
OPENDAL_WEBHDFS_ATOMIC_WRITE_DIR=.opendal_tmp/
OPENDAL_WEBHDFS_USER_NAME=opendal
EOF
6 changes: 3 additions & 3 deletions core/src/services/webhdfs/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ impl WebhdfsBuilder {
/// Set the username of this backend,
/// used for authentication
///
pub fn username(mut self, username: &str) -> Self {
if !username.is_empty() {
self.config.user_name = Some(username.to_string());
pub fn user_name(mut self, user_name: &str) -> Self {
if !user_name.is_empty() {
self.config.user_name = Some(user_name.to_string());
}
self
}
Expand Down

0 comments on commit f4e1ee1

Please sign in to comment.