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

Fix test generation #89

Closed
wants to merge 6 commits into from
Closed
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
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ jobs:
command: test
args: --no-default-features --features alloc

workspace-compiles:
name: "Workspace Compiles"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --workspace

fmt:
name: Rustfmt
runs-on: ubuntu-latest
Expand Down
11 changes: 5 additions & 6 deletions scripts/gentest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
[package]
name = "gentest"
version = "0.1.0"
authors = ["Emil Sjölander <emil@visly.app>"]
edition = "2018"
edition = "2021"

[dependencies]
env_logger = "0.9.0"
failure = "0.1"
fantoccini = "0.19.0"
futures = "0.3"
indicatif = "0.16.2"
json = "0.12.0"
json = "0.12.4"
log = "0.4"
proc-macro2 = "1.0.6"
quote = "1.0.2"
quote = "1.0"
serde_json = "1"
syn = "1.0.7"
tokio = "1.18"
syn = "1.0.9"
tokio = "1.19"
12 changes: 9 additions & 3 deletions scripts/gentest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;

use failure::*;
use failure::Error;
use fantoccini::{Client, Locator};
use futures::{future::Future, stream::Stream, sync::oneshot::channel};
use futures::{channel::oneshot::channel, future::Future};
use json;
use log::*;
use log::{debug, error, info};
use proc_macro2::{Span, TokenStream};
use quote::quote;
use syn::Ident;
Expand Down Expand Up @@ -49,7 +49,9 @@ fn main() {
let (test_descs_sink, mut test_descs) = channel();

info!("spawning webdriver client and collecting test descriptions");
// FIXME: this method no longer exists
tokio::run(
// FIXME: seems to be replaced by https://docs.rs/fantoccini/latest/fantoccini/struct.Client.html#method.with_capabilities_and_connector
Client::with_capabilities(webdriver_url, caps.clone())
.map_err(|e| Error::from(e))
.and_then(move |client| {
Expand Down Expand Up @@ -89,6 +91,7 @@ fn main() {
})
.collect();

// FIXME: type is unclear
let test_descs: Vec<_> = test_descs
.iter()
.map(|(name, description)| {
Expand All @@ -97,6 +100,7 @@ fn main() {
})
.collect();

// FIXME: type is unclear
let benchmarks: Vec<_> = test_descs
.iter()
.map(|(name, _)| {
Expand All @@ -105,6 +109,7 @@ fn main() {
})
.collect();

// FIXME: type is unclear
let test_mods = test_descs
.iter()
.map(|(name, _)| {
Expand Down Expand Up @@ -154,6 +159,7 @@ fn test_root_element(
client: Client,
name: String,
fixture_path: impl AsRef<Path>,
// FIXME: Future's type signature appears to have changed
) -> impl Future<Item = (String, json::JsonValue), Error = Error> {
let fixture_path = fixture_path.as_ref();

Expand Down