Skip to content

Commit

Permalink
chore: add .github
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould authored and ethe committed Jul 16, 2024
1 parent 4635609 commit b5697d6
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 42 deletions.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: "\U0001F41B Bug Report"
about: Something isn't working as expected

---

## Bug Report

**What version of Elsm are you using?**


**What version of Rust are you using?**


**What's the status of the running?**

**What did you do?**
<!-- If possible, provide a recipe for reproducing the error. How you start KipDB. -->

**What did you expect to see?**

**What did you see instead?**
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: "\U0001F680 Feature Request"
about: I have a suggestion

---

## Feature Request

**Is your feature request related to a problem? Please describe:**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the feature you'd like:**
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered:**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Teachability, Documentation, Adoption, Migration Strategy:**
<!-- If you can, explain some scenarios how users might use this, situations it would be helpful in. Any API designs, mockups, or diagrams are also helpful. -->
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: "\U0001F914 Question"
about: Usage question that isn't answered in docs or discussion

---

## Question

Before asking a question, make sure you have:

- Reviewed relevant Rust information: Google your error messages and look at official docs.
- Searched open and closed [GitHub issues](https://github.com/from-the-basement/elsm/issues)
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_MY_REGISTRY_INDEX: https://github.com/rust-lang/crates.io-index

jobs:
# 1
check:
name: Rust project check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install latest
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy

- name: Install Protoc
uses: arduino/setup-protoc@v2

# `cargo check` command here will use installed `nightly`
# as it is set as an "override" for current directory

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check

- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
# 2
fmt:
name: Rust fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy

# `cargo check` command here will use installed `nightly`
# as it is set as an "override" for current directory

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
42 changes: 0 additions & 42 deletions src/inmem/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,46 +157,4 @@ mod tests {
}
)
}

#[test]
fn range() {
let mutable = Mutable::<String>::new();

mutable.insert("1".into(), 0_u32.into());
mutable.insert("2".into(), 0_u32.into());
mutable.insert("2".into(), 1_u32.into());
mutable.insert("3".into(), 1_u32.into());
mutable.insert("4".into(), 0_u32.into());

let mut scan = mutable.scan((Bound::Unbounded, Bound::Unbounded), 0_u32.into());

assert_eq!(
scan.next().unwrap().key(),
&Timestamped::new("1".into(), 0_u32.into())
);
assert_eq!(
scan.next().unwrap().key(),
&Timestamped::new("2".into(), 0_u32.into())
);
assert_eq!(
scan.next().unwrap().key(),
&Timestamped::new("4".into(), 0_u32.into())
);

let lower = "1".to_string();
let upper = "4".to_string();
let mut scan = mutable.scan(
(Bound::Included(&lower), Bound::Included(&upper)),
1_u32.into(),
);

assert_eq!(
scan.next().unwrap().key(),
&Timestamped::new("2".into(), 1_u32.into())
);
assert_eq!(
scan.next().unwrap().key(),
&Timestamped::new("3".into(), 1_u32.into())
);
}
}

0 comments on commit b5697d6

Please sign in to comment.