sunn-e / bddummy

A dummy R package
0 stars 2 forks source link

cross branch experiments #9

Open sunn-e opened 4 years ago

sunn-e commented 4 years ago

Run "dev-dev-ex' workflow on either master or dev . by default we explicitely told to get /dev of bdtests. That means, master-master and dev-master will either need worflow modification or new workflow altogether. let's see.

sunn-e commented 4 years ago

assumptions

## if master-master runs
## 2,4 fails

## if dev-master runs
## 1,4 fails

## if dev-dev runs
## 1,3 fails
test_that("1-bddummy master", {
  expect_equal(foo_bddummy(1), 2)
})

test_that("2-bddummy dev", {
  expect_equal(foo_bddummy(1), 101)
})

test_that("3-bdtest master", {
  expect_equal(bdtests::foo(1), 2)
})

test_that("4-bdtest dev", {
  expect_equal(bdtests::foo(1), 101)
})
sunn-e commented 4 years ago

check master-dev

case: bddummy/master + bdtests/dev expected output:

## if master-dev runs
## 2,3 fails

actual output;

Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
  1/1 mismatches
  [1] 2 - 101 == -99

  ── 2. Failure: 3-bdtest master (@test-foo.R#26)  ───────────────────────────────
  bdtests::foo(1) not equal to 2.
  1/1 mismatches
  [1] 101 - 2 == 99

  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 3 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 2 ]
  1. Failure: 2-bddummy dev (@test-foo.R#22) 
  2. Failure: 3-bdtest master (@test-foo.R#26) 

  Error: testthat unit tests failed
  Execution halted
sunn-e commented 4 years ago

check dev-dev

case: bddummy/dev + bdtests/dev

note: the workflow MUST be in the required branch which is dev of bddummy here.

expected output:

## if dev-dev runs
## 1,3 fails

actual output;

> library(testthat)
> library(bddummy)
> 
> test_check("bddummy")
── 1. Failure: 1-bddummy master (@test-foo.R#18)  ──────────────────────────────
foo_bddummy(1) not equal to 2.
1/1 mismatches
[1] 101 - 2 == 99

── 2. Failure: 3-bdtest master (@test-foo.R#26)  ───────────────────────────────
bdtests::foo(1) not equal to 2.
1/1 mismatches
[1] 101 - 2 == 99

══ testthat results  ═══════════════════════════════════════════════════════════
[ OK: 3 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 2 ]
1. Failure: 1-bddummy master (@test-foo.R#18) 
2. Failure: 3-bdtest master (@test-foo.R#26) 

##[error]Error: testthat unit tests failed
Execution halted