Skip to content

Commit

Permalink
Merge branch 'main' of github.com:earth-metabolome-initiative/emi-mon…
Browse files Browse the repository at this point in the history
…orepo
  • Loading branch information
LucaCappelletti94 committed Feb 9, 2024
2 parents eaeda91 + 846f0fe commit e92118a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/sirius.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ jobs:
toolchain: nightly
override: true
- name: Run tests
env:
SIRIUS_USERNAME: ${{secrets.SIRIUS_USERNAME}}
SIRIUS_PASSWORD: ${{secrets.SIRIUS_PASSWORD}}
run: |
export SIRIUS_PATH=${{vars.SIRIUS_PATH}}
export SIRIUS_USERNAME=${{vars.SIRIUS_USERNAME}}
export SIRIUS_PASSWORD=${{vars.SIRIUS_PASSWORD}}
cargo test --test test_sirius
17 changes: 12 additions & 5 deletions bindings/sirius/src/sirius.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,28 +94,35 @@ impl<V: Version> Sirius<V> {

// We check that the provided sirius username and password are not empty
if sirius_username.is_empty() {
<<<<<<< HEAD
return Err(format!(concat!(
=======
return Err(concat!(
>>>>>>> 846f0feac57a70f394fa531de8010a2013d16a77
"The sirius username provided in the environment variable SIRIUS_USERNAME is empty. ",
"We expected there to exist a .env file in the current directory ",
"with the SIRIUS_USERNAME variable set to the username of the sirius account. ",
"The variable may also be set in the environment directly, for instance ",
"in the .bashrc file."
<<<<<<< HEAD
)));
=======
).to_string());
>>>>>>> 846f0feac57a70f394fa531de8010a2013d16a77
}

if sirius_password.clone().is_empty() {
return Err(format!(
concat!(
if sirius_password.is_empty() {
return Err(concat!(
"The sirius password provided in the environment variable SIRIUS_PASSWORD is empty. ",
"We expected there to exist a .env file in the current directory ",
"with the SIRIUS_PASSWORD variable set to the password of the sirius account. ",
"The variable may also be set in the environment directly, for instance ",
"in the .bashrc file."
)));
).to_string());
}

// Prepare and execute the login command
let mut binding = Command::new(&sirius_path);
let mut binding = Command::new(sirius_path);

// Set both SIRIUS_PASSWORD and SIRIUS_USERNAME environment variables
binding
Expand Down

0 comments on commit e92118a

Please sign in to comment.