Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

chore: refactor push certificate tests and cleanup regtest #399

Merged
merged 8 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
22 changes: 22 additions & 0 deletions .github/workflows/docker_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,25 @@ jobs:
ref: main
wait_interval: 60
client_payload: '{ "topos-docker-tag": "${{ env.docker_tag }}" }'

frontend-erc20-e2e:
runs-on: ubuntu-latest
needs: docker
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Set environment
run: |
# It's fine to assume a single tag. Our tagging strategy follows a 1:1 mapping of image:tag
tags=${{ needs.docker.outputs.tags }}
echo "docker_tag=${tags#*:}" >> $GITHUB_ENV
shell: bash

- uses: convictional/[email protected]
with:
owner: topos-protocol
repo: e2e-tests
github_token: ${{ secrets.ROBOT_PAT_TRIGGER_E2E_WORKFLOWS }}
workflow_file_name: frontend:erc20-messaging.yml
ref: main
wait_interval: 60
client_payload: '{ "topos-docker-tag": "${{ env.docker_tag }}" }'
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/topos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ rstest = { workspace = true, features = ["async-timeout"] }
tempfile = "3.8.0"
predicates = "3.0.3"
sysinfo = "0.29.11"
serial_test = {version = "0.9.0"}
hadjiszs marked this conversation as resolved.
Show resolved Hide resolved

[features]
default = []
4 changes: 0 additions & 4 deletions crates/topos/src/components/regtest/commands.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use clap::{Args, Subcommand};

mod push_certificate;
mod spam;

pub(crate) use push_certificate::PushCertificate;
pub(crate) use spam::Spam;

/// Run test commands (e.g., pushing a certificate to a TCE process)
Expand All @@ -18,7 +16,6 @@ pub(crate) struct RegtestCommand {

#[derive(Subcommand, Debug)]
pub(crate) enum RegtestCommands {
PushCertificate(Box<PushCertificate>),
Spam(Box<Spam>),
}

Expand All @@ -28,7 +25,6 @@ mod tests {

#[test]
fn test_run() {
assert!(RegtestCommands::has_subcommand("push-certificate"));
assert!(RegtestCommands::has_subcommand("spam"));
}
}

This file was deleted.

25 changes: 1 addition & 24 deletions crates/topos/src/components/regtest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ use tokio::{
sync::{mpsc, oneshot},
};
use topos_certificate_spammer::CertificateSpammerConfig;
use tracing::{debug, error, info};
use tracing::{error, info};
use tracing_opentelemetry::OpenTelemetrySpanExt;

use crate::tracing::setup_tracing;

pub(crate) mod commands;
pub(crate) mod services;

pub(crate) async fn handle_command(
RegtestCommand {
Expand All @@ -21,28 +20,6 @@ pub(crate) async fn handle_command(
}: RegtestCommand,
) -> Result<(), Box<dyn std::error::Error>> {
match subcommands {
Some(RegtestCommands::PushCertificate(cmd)) => {
_ = setup_tracing(verbose, false, None, None)?;
debug!("Start executing PushCertificate command");
match services::push_certificate::check_delivery(
cmd.timeout_broadcast,
cmd.format,
cmd.nodes,
cmd.timeout,
)
.await
.map_err(Box::<dyn std::error::Error>::from)
{
Err(e) => {
error!("Check failed: {:?}", e);
std::process::exit(1);
}
_ => {
info!("Check passed");
Ok(())
}
}
}
Some(RegtestCommands::Spam(cmd)) => {
let config = CertificateSpammerConfig {
target_nodes: cmd.target_nodes,
Expand Down
1 change: 0 additions & 1 deletion crates/topos/src/components/regtest/services.rs

This file was deleted.

Loading
Loading