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

[DNM] vendor, tests, Bump to ginkgo v2 #362

Closed
wants to merge 3 commits into from

Conversation

RamLavi
Copy link
Member

@RamLavi RamLavi commented Mar 15, 2022

What this PR does / why we need it:
This PR bumps kubemacpool to ginkgo v2

Special notes for your reviewer:
Once this PR is merged we may need to update CNAO's KMP tier1 test flags.
Release note:

NONE

@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from ramlavi after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@RamLavi RamLavi force-pushed the bump_ginkgo_v2 branch 2 times, most recently from 96bbe22 to 5b6610f Compare March 17, 2022 08:41
@@ -6,7 +6,7 @@ teardown() {
}

main() {
export KUBEVIRT_PROVIDER='k8s-1.23'
export KUBEVIRT_PROVIDER='k8s-1.21'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related right ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, thanks!

@RamLavi
Copy link
Member Author

RamLavi commented Mar 20, 2022

@qinqon @oshoval I'm getting a strange error

package github.com/k8snetworkplumbingwg/kubemacpool: build constraints exclude all Go files in /home/ralavi/go/src/github.com/k8snetworkplumbingwg/kubemacpool

did we add any build constraints recently? I didn't find any on any non vendor folders.. could we be blocked by vendor folders?

@oshoval
Copy link
Member

oshoval commented Mar 20, 2022

@qinqon @oshoval I'm getting a strange error

package github.com/k8snetworkplumbingwg/kubemacpool: build constraints exclude all Go files in /home/ralavi/go/src/github.com/k8snetworkplumbingwg/kubemacpool

did we add any build constraints recently? I didn't find any on any non vendor folders.. could we be blocked by vendor folders?

dont know by heart
i would check GOARCH / GOOS
https://stackoverflow.com/questions/55348458/build-constraints-exclude-all-go-files-in
or this one golang/go#24068 that also have the mentioned error

@@ -17,7 +17,7 @@ main() {
make cluster-up
trap teardown EXIT SIGINT SIGTERM SIGSTOP
make cluster-sync
make E2E_TEST_ARGS="-ginkgo.noColor --junit-output=$ARTIFACTS/junit.functest.xml" functest
make E2E_TEST_ARGS="-ginkgo.noColor --ginkgo.junit-report=$ARTIFACTS/junit.functest.xml" functest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to use --output-dir $ARTIFACTS, and to remove the dir from the junit report please

remove also all the teardown that manipulate those files

note that spyglass doesn't print errors good until there will be a bump of it

Copy link
Member Author

@RamLavi RamLavi Jun 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see if it works

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks
Q: Dont we still need --junit-output in addition ?
unless the default file name that is used is good

Copy link
Member Author

@RamLavi RamLavi Jun 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it isn't, you're right, updated the link above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure --output-dir is operational?

$ /home/ralavi/go/src/github.com/k8snetworkplumbingwg/kubemacpool/build/_output/bin//go//bin//go test ./tests/... -test.timeout=2h --ginkgo.timeout=2h -race -test.v -ginkgo.noColor --output-dir=/logs/artifacts --junit-report=junit.functest.xml -ginkgo.v
flag provided but not defined: -output-dir
Controlling Test Order
  --ginkgo.seed [int] (default: randomly generated by Ginkgo)
    The seed used to randomize the spec suite.
  --ginkgo.randomize-all 
    If set, ginkgo will randomize all specs together.  By default, ginkgo only
    randomizes the top level Describe, Context and When containers.

Controlling Test Parallelism
These are set by the Ginkgo CLI, do not set them manually via go test.
Use ginkgo -p or ginkgo -procs=N instead.
  --ginkgo.parallel.process [int] (default: 1)
    This worker process's (one-indexed) process number.  For running specs in
    parallel.
  --ginkgo.parallel.total [int] (default: 1)
    The total number of worker processes.  For running specs in parallel.
  --ginkgo.parallel.host [string] (default: set by Ginkgo CLI)
    The address for the server that will synchronize the processes.

Filtering Tests
  --ginkgo.label-filter [expression] 
    If set, ginkgo will only run specs with labels that match the label-filter. 
    The passed-in expression can include boolean operations (!, &&, ||, ','),
    groupings via '()', and regular expressions '/regexp/'.  e.g. '(cat || dog)
    && !fruit'
  --ginkgo.focus [string] 
    If set, ginkgo will only run specs that match this regular expression. Can
    be specified multiple times, values are ORed.
  --ginkgo.skip [string] 
    If set, ginkgo will only run specs that do not match this regular
    expression. Can be specified multiple times, values are ORed.
  --ginkgo.focus-file [file (regexp) | file:line | file:lineA-lineB | file:line,line,line] 
    If set, ginkgo will only run specs in matching files. Can be specified
    multiple times, values are ORed.
  --ginkgo.skip-file [file (regexp) | file:line | file:lineA-lineB | file:line,line,line] 
    If set, ginkgo will skip specs in matching files. Can be specified multiple
    times, values are ORed.

Failure Handling
  --ginkgo.fail-on-pending 
    If set, ginkgo will mark the test suite as failed if any specs are pending.
  --ginkgo.fail-fast 
    If set, ginkgo will stop running a test suite after a failure occurs.
  --ginkgo.flake-attempts [int] (default: 0 - failed tests are not retried)
    Make up to this many attempts to run each spec. If any of the attempts
    succeed, the suite will not be failed.

Controlling Output Formatting
  --ginkgo.no-color 
    If set, suppress color output in default reporter.
  --ginkgo.slow-spec-threshold [duration] (default: 5s)
    Specs that take longer to run than this threshold are flagged as slow by the
    default reporter.
  --ginkgo.v 
    If set, emits more output including GinkgoWriter contents.
  --ginkgo.vv 
    If set, emits with maximal verbosity - includes skipped and pending tests.
  --ginkgo.succinct 
    If set, default reporter prints out a very succinct report
  --ginkgo.trace 
    If set, default reporter prints out the full stack trace when a failure
    occurs
  --ginkgo.always-emit-ginkgo-writer 
    If set, default reporter prints out captured output of passed tests.
  --ginkgo.json-report [filename.json] 
    If set, Ginkgo will generate a JSON-formatted test report at the specified
    location.
  --ginkgo.junit-report [filename.xml] 
    If set, Ginkgo will generate a conformant junit test report in the specified
    file.
  --ginkgo.teamcity-report [filename] 
    If set, Ginkgo will generate a Teamcity-formatted test report at the
    specified location.

Debugging Tests
In addition to these flags, Ginkgo supports a few debugging environment
variables.  To change the parallel server protocol set GINKGO_PARALLEL_PROTOCOL
to HTTP.  To avoid pruning callstacks set GINKGO_PRUNE_STACK to FALSE.
  --ginkgo.dry-run 
    If set, ginkgo will walk the test hierarchy without actually running
    anything.  Best paired with -v.
  --ginkgo.progress 
    If set, ginkgo will emit progress information as each spec runs to the
    GinkgoWriter.
  --ginkgo.timeout [duration] (default: 1h)
    Test suite fails if it does not complete within the specified timeout.
  --ginkgo.output-interceptor-mode [dup, swap, or none] 
    If set, ginkgo will use the specified output interception strategy when
    running in parallel.  Defaults to dup on unix and swap on windows.

Go test flags
  -kubeconfig string
    	Paths to a kubeconfig. Only required if out-of-cluster.
  -test.bench regexp
    	run only benchmarks matching regexp
  -test.benchmem
    	print memory allocations for benchmarks
  -test.benchtime d
    	run each benchmark for duration d
  -test.blockprofile file
    	write a goroutine blocking profile to file
  -test.blockprofilerate rate
    	set blocking profile rate (see runtime.SetBlockProfileRate)
  -test.count n
    	run tests and benchmarks n times
  -test.coverprofile file
    	write a coverage profile to file
  -test.cpu list
    	comma-separated list of cpu counts to run each test with
  -test.cpuprofile file
    	write a cpu profile to file
  -test.failfast
    	do not start new tests after the first test failure
  -test.fuzz regexp
    	run the fuzz test matching regexp
  -test.fuzzcachedir string
    	directory where interesting fuzzing inputs are stored (for use only by cmd/go)
  -test.fuzzminimizetime value
    	time to spend minimizing a value after finding a failing input
  -test.fuzztime value
    	time to spend fuzzing; default is to run indefinitely
  -test.fuzzworker
    	coordinate with the parent process to fuzz random values (for use only by cmd/go)
  -test.list regexp
    	list tests, examples, and benchmarks matching regexp then exit
  -test.memprofile file
    	write an allocation profile to file
  -test.memprofilerate rate
    	set memory allocation profiling rate (see runtime.MemProfileRate)
  -test.mutexprofile string
    	write a mutex contention profile to the named file after execution
  -test.mutexprofilefraction int
    	if >= 0, calls runtime.SetMutexProfileFraction()
  -test.outputdir dir
    	write profiles to dir
  -test.paniconexit0
    	panic on call to os.Exit(0)
  -test.parallel n
    	run at most n tests in parallel
  -test.run regexp
    	run only tests and examples matching regexp
  -test.short
    	run smaller test suite to save time
  -test.shuffle string
    	randomize the execution order of tests and benchmarks
  -test.testlogfile file
    	write test action log to file (for use only by cmd/go)
  -test.timeout d
    	panic test binary after duration d (default 0, timeout disabled)
  -test.trace file
    	write an execution trace to file
  -test.v
    	verbose: print additional output

FAIL	github.com/k8snetworkplumbingwg/kubemacpool/tests	0.196s
?   	github.com/k8snetworkplumbingwg/kubemacpool/tests/kubectl	[no test files]
FAIL

Copy link
Member

@oshoval oshoval Jun 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://onsi.github.io/ginkgo/MIGRATING_TO_V2#generating-machine-readable-reports
yes
you can see other repos like k8s-nmstate i think, where it is used when bumped to ginkgo 2.0
nmstate/kubernetes-nmstate@9f3ab72#diff-243247ac0c068ea424017634b68103f66ed15e57ce5eb13a5609dfd5c3d4775dR34

EDIT - it affects only when you use the new reporter, --junit-report
if you want, lets postpone it to a new PR, but we do use the new --junit-report aren't we ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do.. so.. I don't understand why it doesn't work. checking..

@RamLavi RamLavi force-pushed the bump_ginkgo_v2 branch 3 times, most recently from 50c7392 to a5667fe Compare May 19, 2022 08:36
@RamLavi RamLavi force-pushed the bump_ginkgo_v2 branch 3 times, most recently from 877f0e3 to 452e0da Compare June 20, 2022 12:08
@@ -1,9 +1,5 @@
#!/bin/bash -e

teardown() {
Copy link
Member

@oshoval oshoval Jun 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove line 11 please then

@oshoval
Copy link
Member

oshoval commented Jun 20, 2022

If the vendor folder can be in a different commit please it would be great, thanks
easier to review and see we don't miss stuff

@RamLavi RamLavi force-pushed the bump_ginkgo_v2 branch 2 times, most recently from b34725b to af4e272 Compare June 21, 2022 07:45
@RamLavi RamLavi changed the title vendor, bump to ginkgo v2 vendor, tests, Bump to ginkgo v2 Jun 21, 2022
in ginkgo v2 there is a new way to configure the artifacts folder
This iliminates the need to copy the artifactson teardown.

Signed-off-by: Ram Lavi <[email protected]>
@kubevirt-bot
Copy link
Collaborator

@RamLavi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubemacpool-e2e-k8s 0a09ee3 link true /test pull-kubemacpool-e2e-k8s

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@kubevirt-bot
Copy link
Collaborator

@RamLavi: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@RamLavi RamLavi changed the title vendor, tests, Bump to ginkgo v2 [DNM] vendor, tests, Bump to ginkgo v2 Dec 8, 2022
@RamLavi
Copy link
Member Author

RamLavi commented Dec 8, 2022

closing in favor of #382

@RamLavi RamLavi closed this Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants