-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
268 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Licensed 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The MIT License (MIT) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Rust Ceramic Migration Tests | ||
|
||
Tests needed to verify the migration from [Kubo](https://github.com/ceramicnetwork/go-ipfs-daemon) to | ||
[rust-ceramic](https://github.com/3box/rust-ceramic) when used with | ||
[Ceramic](https://github.com/ceramicnetwork/js-ceramic) nodes. | ||
|
||
## Contributing | ||
|
||
We are happy to accept small and large contributions, feel free to make a suggestion or submit a pull request. | ||
|
||
Use the provided `Makefile` for basic actions to ensure your changes are ready for CI. | ||
|
||
$ make build | ||
$ make check-clippy | ||
$ make check-fmt | ||
|
||
Using the makefile is not necessary during your development cycle, feel free to use the relevant cargo commands | ||
directly. However, running `make` before publishing a PR will provide a good signal if your PR will pass CI. | ||
|
||
## License | ||
|
||
Fully open source and dual-licensed under MIT and Apache 2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CERAMIC_URLS=https://ceramic-private-dev.3boxlabs.com,https://ceramic-dev.3boxlabs.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,41 @@ | ||
#[cfg(test)] | ||
pub mod tests { | ||
use std::env; | ||
use std::path::Path; | ||
|
||
use rstest::{fixture, rstest}; | ||
use tracing_test::traced_test; | ||
|
||
#[test] | ||
const CERAMIC_URLS: &str = "CERAMIC_URLS"; | ||
const DEFAULT_ENV_PATH: &str = "env/.env"; | ||
const ENV_PATH: &str = "ENV_PATH"; | ||
|
||
#[fixture] | ||
#[once] | ||
fn initialize() { | ||
dotenvy::from_path(Path::new( | ||
env::var(ENV_PATH) | ||
.unwrap_or(DEFAULT_ENV_PATH.to_owned()) | ||
.as_str(), | ||
)) | ||
.expect("Could not find .env file"); | ||
} | ||
|
||
fn print_ceramic_urls() { | ||
println!("{:?}", env::var(CERAMIC_URLS).unwrap_or_default()); | ||
} | ||
|
||
#[rstest] | ||
#[traced_test] | ||
fn test_1() { | ||
println!("Hello world!"); | ||
fn test_1(_initialize: ()) { | ||
println!("Hello Ceramic!"); | ||
print_ceramic_urls(); | ||
} | ||
|
||
#[test] | ||
#[rstest] | ||
#[traced_test] | ||
fn test_2() { | ||
println!("Goodbye world!"); | ||
fn test_2(_initialize: ()) { | ||
println!("Goodbye Ceramic!"); | ||
print_ceramic_urls(); | ||
} | ||
} |