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

test: add fluxtest harness #21074

Merged
merged 23 commits into from
Mar 30, 2021
Merged

Conversation

danxmoran
Copy link
Contributor

@danxmoran danxmoran commented Mar 25, 2021

Closes #21072

The logic here is a mix of:

TODO list:

  • Make etc/test-flux.sh run at all
  • Make etc/test-flux.sh pass
  • Add etc/test-flux.sh to CI

config.HTTPD.FluxTestingEnabled = true

// NOTE: This will panic on failure. Not changing it for now.
e.s = tests.OpenServer(config)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm torn between this approach and spinning up a separate Influxd process for a real integration test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd vote for leaving it as-is for now, to mirror 2.x.

@danxmoran danxmoran force-pushed the dm-backport-flux-test-harness-21072 branch from c0ee3e8 to d26687e Compare March 25, 2021 19:00
BucketID string `json:"bucketID,omitempty"`
}

func init() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This logic was performing the same rewrite logic as the new FromStorageRule pushdown. I thought it'd be good to refactor into a 1:1 match with the 2.x code, so future back-/forward-ports have fewer differences to think through.

@@ -10,6 +10,7 @@
# 2: normal 32bit tests
# 3: tsi build
# count: print the number of test environments
# flux: run Flux e2e tests via the external test harness
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't add a new number for this because I wanted these tests to run in a separate CI job

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this - should we plan to move the rest of the tests to their own CI jobs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would vote for yes (2.x is already there, it's nice to see more fine-grained reporting)

Copy link
Contributor

Choose a reason for hiding this comment

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

@codyshepherd FYI ☝️

Copy link
Contributor

Choose a reason for hiding this comment

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

@lesam would you say that the following issues capture the to-do indicated by this conversation? Or do we need a new issue?

#17573
#21074
influxdata/plutonium#3103

@danxmoran danxmoran marked this pull request as ready for review March 26, 2021 14:18
@@ -70,7 +70,8 @@ type Server struct {
BindAddress string
Listener net.Listener

Logger *zap.Logger
Logger *zap.Logger
MuxLogger *log.Logger
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pulled this up to the top level so we can redirect it during tests and not see a bunch of "failed to connect" logs from startup.

@danxmoran danxmoran requested a review from lesam March 26, 2021 17:45
Copy link
Contributor

@codyshepherd codyshepherd left a comment

Choose a reason for hiding this comment

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

Most of this is over my head, but I have two things to point out:

  • Xenial Ubuntu (16.04) is almost EOL -- it might be a good idea to start moving dockerfiles to Bionic (18.04) or Focal (20.04)
  • This isn't isolated to just you, but I'd like to see functions documented in the Godoc style (regular comments directly preceding the function definition)

@@ -10368,7 +10369,7 @@ func runFluxBuiltinTest(t *testing.T, file *ast.File, u *url.URL, bucket string,

inspectCalls := stdlib.TestingInspectCalls(pkg)
if len(inspectCalls.Body) == 0 {
t.Skip("No tests in builtin test package")
t.Skip("No tests in init test package")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need the EndToEnd tests built in if we're running externally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Flux team said yes (for now), because they haven't fully reproduced the existing test-cases yet. I'll make a ticket for eventually deleting EndToEnd

@@ -1,4 +1,4 @@
#!/usr/bin/python2.7 -u
#!/usr/bin/env python3
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were getting away with using Python 2 because of the old Ubuntu base image. Luckily it seems we weren't using anything specific to v2

@@ -0,0 +1,50 @@
package universe_test
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was in the Flux repo, but it was recently commented out (I assume because IDPE hasn't implemented the pushdown yet). Transferred it here so we're protected against regressions on this rewrite rule.

lesam
lesam previously approved these changes Mar 29, 2021
Copy link
Contributor

@lesam lesam left a comment

Choose a reason for hiding this comment

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

ok as long as CI logs look good

@danxmoran danxmoran merged commit fbfd4b4 into master-1.x Mar 30, 2021
@danxmoran danxmoran deleted the dm-backport-flux-test-harness-21072 branch March 30, 2021 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants