Skip to content

Commit

Permalink
Merge branch '2.9' into 2.9-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRichardson committed Mar 28, 2022
2 parents 841f3bb + 077a06b commit 9d2a7d0
Show file tree
Hide file tree
Showing 151 changed files with 1,988 additions and 1,190 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check if CLA signed
uses: canonical/has-signed-canonical-cla@v1
uses: canonical/has-signed-canonical-cla@3eb79ef290553f0de096b3948a6770c15171fb15 # v1
with:
accept-existing-contributors: true
8 changes: 4 additions & 4 deletions .github/workflows/client-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3

- name: Find required go version
id: go-version
Expand All @@ -43,7 +43,7 @@ jobs:
echo "::set-output name=version::$(grep '^go ' go.mod | awk '{print $2}')"
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3
with:
go-version: ${{ steps.go-version.outputs.version }}
id: go
Expand All @@ -55,13 +55,13 @@ jobs:
- name: "Remove Mongo Dependencies: windows-latest"
if: (matrix.os == 'windows-latest')
uses: crazy-max/ghaction-chocolatey@v1
uses: crazy-max/ghaction-chocolatey@87d06bbbd2cfb1835f1820042d356aef4875fb5f # v1
with:
args: uninstall mongodb mongodb.install -y --all-versions

- name: "Install Mongo Dependencies: windows-latest"
if: (matrix.os == 'windows-latest')
uses: crazy-max/ghaction-chocolatey@v1
uses: crazy-max/ghaction-chocolatey@87d06bbbd2cfb1835f1820042d356aef4875fb5f # v1
with:
args: install mongodb.install --version=5.0.5 --allow-downgrade

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/microk8s-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checking out repo
uses: actions/checkout@v3
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3

- name: Find required go version
id: go-version
Expand All @@ -29,7 +29,7 @@ jobs:
echo "::set-output name=version::$(grep '^go ' go.mod | awk '{print $2}')"
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v3
with:
go-version: ${{ steps.go-version.outputs.version }}
id: go
Expand All @@ -40,7 +40,7 @@ jobs:
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- uses: balchua/[email protected]
- uses: balchua/microk8s-actions@98f481ca6bad1cdca5185008b9572a3102d46af3 # v0.2.2
with:
channel: '${{ matrix.microk8s }}'
# enable now to give microk8s more time to settle down.
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
if: ${{ failure() }}

- name: Upload debug log
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
with:
name: juju-debug-actions
path: juju-debug.log
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
if: ${{ failure() }}

- name: Upload inspect tarball
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
with:
name: inspection-report-actions
path: ./inspection-report-${{ strategy.job-index }}.tar.gz
Expand All @@ -169,7 +169,7 @@ jobs:
if: ${{ failure() }}

- name: Upload kubectl describe
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
with:
name: kubectl-describe-actions
path: describe/*.describe
Expand All @@ -187,7 +187,7 @@ jobs:
if: ${{ failure() }}

- name: Upload kubeflow pod logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
with:
name: kubectl-stdout-actions
path: stdout/*.log
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-brew-formulae.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Update Homebrew formulae
uses: dawidd6/action-homebrew-bump-formula@master
uses: dawidd6/action-homebrew-bump-formula@b1f4659559bcc32ab942f0b0f851e3c856d05253 # master
with:
token: "${{ secrets.TOKEN }}"
formula: juju
Expand Down
11 changes: 7 additions & 4 deletions acceptancetests/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Juju Functional Tests
# Juju Legacy Functional Tests

**These are the legacy acceptance tests written in Python. The new functional tests are in the top-level `tests` directory and are written in Bash.**

## Running Test Scripts

Expand Down Expand Up @@ -29,16 +31,17 @@ $ sudo apt install python-simplestreams
* Create a **JUJU_DATA** dir for use for the duration of the test. The directory is created in: $JUJU_HOME/juju-homes/.
* **JUJU_REPOSITORY**: The directory containing the local dummy charms. You can use '\<juju root\>/acceptancetests/repository'.

### Quick run using `access.py`
`access.py` encapsulate the creating of yaml and env vars which can be further seen below, by setting some sane defaults
### Quick run using `./assess`

The `./assess` script encapsulates the creating of yaml and env vars which can be further seen below, by setting some sane defaults
which you have to set yourself else.

Defaults currently are: `(lxd, bionic, tempdir..)`. Those can be changed during each run by setting the respective parameter.


To run `assess_min_version.py` test locally with lxd and locally compiled juju:
```shell script
cd $GOPATH/src/github.com/juju/juju/acceptancetests
cd acceptancetests
./assess min_version
```

Expand Down
15 changes: 5 additions & 10 deletions acceptancetests/assess
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ def list_tests():


def default_juju_bin():
try:
gopath = os.environ["GOPATH"]
except LookupError:
return
return os.path.join(gopath, "bin", "juju")
home = os.environ.get("HOME")
if not home:
return None
return os.path.join(home, "go", "bin", "juju")


def tempdir_prefix(test=""):
Expand Down Expand Up @@ -206,7 +205,7 @@ def parse_args():
pass_through.add_argument("--secondary-env", metavar="ENV",
help="(Only relevant for the cross_model_relations test)")
pass_through.add_argument("--secondary-region", "--other-region", metavar="REGION", dest="secondary_region",
help="(Only relevant for the cross_model_relations, model_defaults tests)")
help="(Only relevant for the cross_model_relations tests)")
pass_through.add_argument("--reporting-uri", metavar="URI",
help="URI to send metrics to. (Only relevant for webscale_deploy test) [default: \"http://root:root@localhost:8086\"]",
default="http://root:root@localhost:8086")
Expand Down Expand Up @@ -367,7 +366,6 @@ def main():

testrun_env = {
"PATH": os.environ["PATH"],
"GOPATH": os.environ["GOPATH"],
"JUJU_HOME": args.juju_home,
"JUJU_DATA": args.juju_data,
"JUJU_REPOSITORY": args.juju_repository,
Expand Down Expand Up @@ -493,9 +491,6 @@ def main():
elif assess == "mixed_images":
if args.image_metadata_url:
testrun_argv.extend(["--image-metadata-url", args.image_metadata_url])
elif assess == "model_defaults":
if args.secondary_region:
testrun_argv.extend(["--other-region", args.secondary_region])
elif assess == "model_migration_versions":
if args.stable_juju_bin:
testrun_argv.extend(["--stable-juju-bin", args.stable_juju_bin])
Expand Down
152 changes: 0 additions & 152 deletions acceptancetests/assess_model_defaults.py

This file was deleted.

11 changes: 11 additions & 0 deletions api/agent/reboot/reboot.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/juju/errors"
"github.com/juju/names/v4"

"github.com/juju/juju/api"
"github.com/juju/juju/api/base"
apiwatcher "github.com/juju/juju/api/watcher"
"github.com/juju/juju/core/watcher"
Expand Down Expand Up @@ -49,6 +50,16 @@ func NewState(caller base.APICaller, machineTag names.MachineTag) State {
}
}

// ConnectionReboot returns access to the Reboot API
func NewFromConnection(c api.Connection) (State, error) {
switch tag := c.AuthTag().(type) {
case names.MachineTag:
return NewState(c, tag), nil
default:
return nil, errors.Errorf("expected names.MachineTag, got %T", tag)
}
}

// WatchForRebootEvent implements State.WatchForRebootEvent
func (st *state) WatchForRebootEvent() (watcher.NotifyWatcher, error) {
var result params.NotifyWatchResult
Expand Down
2 changes: 1 addition & 1 deletion api/agent/reboot/reboot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (s *machineRebootSuite) SetUpTest(c *gc.C) {
s.JujuConnSuite.SetUpTest(c)
var err error
s.st, s.machine = s.OpenAPIAsNewMachine(c)
s.reboot, err = s.st.Reboot()
s.reboot, err = reboot.NewFromConnection(s.st)
c.Assert(err, jc.ErrorIsNil)
c.Assert(s.reboot, gc.NotNil)
}
Expand Down
Loading

0 comments on commit 9d2a7d0

Please sign in to comment.