Skip to content

Commit

Permalink
fix: CI/CD pipepline
Browse files Browse the repository at this point in the history
  • Loading branch information
raghav-rama committed Feb 11, 2024
1 parent d344aa4 commit 0eb1f0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ jobs:
- uses: actions/checkout@v4
- name: Set up linker
run: docker build -t 860x9/rust_nuggets:latest .
- name: Setup testing image
run: docker run -d -p 8080:80 kennethreitz/httpbin
- name: Run tests in docker container
run: docker run --rm 860x9/rust_nuggets cargo test --release --verbose
- name: Clean up testing image
- name: Stop up testing container
run: docker kill $(docker ps -q)
- name: Delete testing image
- name: Delete testing container
run: docker rm $(docker ps -a -q)
- name: Login to Docker Hub
uses: docker/login-action@v3
Expand Down
2 changes: 1 addition & 1 deletion src/bin/blocking_get_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ error_chain! {
}

fn main() -> Result<()> {
let mut response = get("http://localhost:8080/get")?;
let mut response = get("http://localhost/get")?;
let mut body = String::new();
response.read_to_string(&mut body)?;
println!("Status: {}", response.status());
Expand Down
4 changes: 2 additions & 2 deletions src/bin/tests/blocking_get_request_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mod blocking_get_request_test {

#[test]
fn it_deserializes_properly() -> Result<()> {
let res = get("http://localhost:8080/get")?;
let res = get("http://localhost/get")?;
let headers = res.headers();
let mut headers_hashmap = HashMap::new();
headers.iter().for_each(|(name, value)| {
Expand All @@ -56,7 +56,7 @@ mod blocking_get_request_test {

#[test]
fn it_gets_a_response() -> Result<()> {
let response = get("http://localhost:8080/get")?;
let response = get("http://localhost/get")?;
assert_eq!(response.status(), 200);
Ok(())
}
Expand Down

0 comments on commit 0eb1f0d

Please sign in to comment.