-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gracefully shutdown reporter & add agent-test-tool based e2e case (#9)
- Loading branch information
Showing
16 changed files
with
156 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: test | ||
name: codecov | ||
on: | ||
pull_request: | ||
push: | ||
|
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,25 @@ | ||
name: agent-test-tool | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
e2e-rust: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Prepare service container | ||
run: docker-compose -f docker-compose.e2e.yml up --build -d | ||
- name: Run e2e | ||
run: | | ||
pip3 install --upgrade pip | ||
pip3 install setuptools | ||
pip3 install -r requirements.txt | ||
python3 tests/e2e/run_e2e.py --expected_file=tests/e2e/data/expected_context.yaml --max_retry_times=3 --target_path=/ping |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,39 @@ | ||
version: "3.7" | ||
version: "3.9" | ||
services: | ||
collector: | ||
build: | ||
context: . | ||
dockerfile: ./tests/e2e/docker/Dockerfile.tool | ||
image: ghcr.io/apache/skywalking-agent-test-tool/mock-collector:5acb890f225ca37ee60675ce3e330545e23e3cbc | ||
ports: | ||
- 19876:19876 | ||
- 12800:12800 | ||
- "19876:19876" | ||
- "12800:12800" | ||
healthcheck: | ||
test: [ "CMD", "curl", "http://0.0.0.0:12800/healthCheck" ] | ||
interval: 5s | ||
timeout: 5s | ||
|
||
consumer: | ||
build: | ||
context: . | ||
dockerfile: ./tests/e2e/docker/Dockerfile | ||
expose: | ||
expose: | ||
- 8082 | ||
command: cargo run -- --mode consumer | ||
command: --mode consumer | ||
depends_on: | ||
- collector | ||
collector: | ||
condition: service_healthy | ||
healthcheck: | ||
test: [ "CMD", "curl", "http://0.0.0.0:8082/healthCheck" ] | ||
interval: 5s | ||
timeout: 5s | ||
|
||
producer: | ||
build: | ||
context: . | ||
dockerfile: ./tests/e2e/docker/Dockerfile | ||
ports: | ||
- 8081:8081 | ||
command: cargo run -- --mode producer | ||
- "8081:8081" | ||
command: --mode producer | ||
depends_on: | ||
- collector | ||
- consumer | ||
collector: | ||
condition: service_healthy | ||
consumer: | ||
condition: service_healthy |
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,14 +1,17 @@ | ||
use std::error::Error; | ||
|
||
use skywalking_rust::context::trace_context::TracingContext; | ||
use skywalking_rust::reporter::grpc::Reporter; | ||
use tokio; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let tx = Reporter::start("http://0.0.0.0:11800").await; | ||
async fn main() -> Result<(), Box<dyn Error>> { | ||
let reporter = Reporter::start("http://0.0.0.0:11800").await; | ||
let mut context = TracingContext::default("service", "instance"); | ||
{ | ||
let span = context.create_entry_span("op1").unwrap(); | ||
context.finalize_span(span); | ||
} | ||
let _ = tx.send(context).await; | ||
reporter.sender().send(context).await?; | ||
reporter.shutdown().await?; | ||
Ok(()) | ||
} |
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,3 @@ | ||
[toolchain] | ||
channel = "1.57.0" | ||
components = ["rustfmt", "clippy"] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM rust:1.50.0 | ||
RUN apt update && apt install -y protobuf-compiler | ||
RUN rustup component add rustfmt | ||
COPY . /tmp | ||
WORKDIR tmp/tests/e2e | ||
FROM rust:1.57 as build | ||
WORKDIR /build | ||
COPY . /build/ | ||
RUN cd tests/e2e && cargo build --release --locked | ||
ENTRYPOINT ["/build/tests/e2e/target/release/e2e"] |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[toolchain] | ||
channel = "1.57.0" | ||
components = ["rustfmt", "clippy"] |
Oops, something went wrong.