Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ff #36

Merged
merged 7 commits into from
Aug 27, 2023
Merged

ff #36

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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ setup:
publish:
maturin publish

test: test-python test-rust

test-python:
pytest -vs tests/python
rm -rf tests/work/*
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ To run tests, use the following command.
```shell
make test
```

You can choose to run just the Python or Rust tests by calling `make test-python` or `make test-rust` respectively.

You can skip S3 related tests by exporting `DOLMA_TESTS_SKIP_AWS=True`

```shell
DOLMA_TESTS_SKIP_AWS=True make test
```

## Contributing

Before committing, use the following command
Expand Down
18 changes: 18 additions & 0 deletions src/s3_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ mod test {

#[test]
fn test_object_size() -> Result<(), io::Error> {
if std::env::var_os("DOLMA_TESTS_SKIP_AWS")
.is_some_and(|var| var.eq_ignore_ascii_case("true"))
{
println!("Skipping test_download_file because DOLMA_TESTS_SKIP_AWS=True");
return Ok(());
}
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
Expand All @@ -288,6 +294,12 @@ mod test {

#[test]
fn test_download_file() -> Result<(), io::Error> {
if std::env::var_os("DOLMA_TESTS_SKIP_AWS")
.is_some_and(|var| var.eq_ignore_ascii_case("true"))
{
println!("Skipping test_download_file because DOLMA_TESTS_SKIP_AWS=True");
return Ok(());
}
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
Expand All @@ -311,6 +323,12 @@ mod test {

#[test]
fn test_find_objects_matching_patterns() -> Result<(), io::Error> {
if std::env::var_os("DOLMA_TESTS_SKIP_AWS")
.is_some_and(|var| var.eq_ignore_ascii_case("true"))
{
println!("Skipping test_download_file because DOLMA_TESTS_SKIP_AWS=True");
return Ok(());
}
let s3_client = new_client(None)?;

let patterns =
Expand Down
Loading